diff --git a/InvenTree/key.py b/InvenTree/key.py index 60ff54df18..c28b9c6a30 100644 --- a/InvenTree/key.py +++ b/InvenTree/key.py @@ -6,11 +6,13 @@ import os fn = 'secret_key.txt' + def generate_key(): options = string.digits + string.ascii_letters + string.punctuation key = ''.join([random.choice(options) for i in range(50)]) return key + if __name__ == '__main__': # Ensure key file is placed in same directory as this script @@ -19,4 +21,4 @@ if __name__ == '__main__': with open(key_file, 'w') as kf: kf.write(generate_key()) - print('Generated SECRET_KEY to {f}'.format(f=key_file)) \ No newline at end of file + print('Generated SECRET_KEY to {f}'.format(f=key_file))