1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Introduced a script to generate SECRET_KEY; removed example SECRET_KEY

This commit is contained in:
Jeremy Stretch
2016-06-21 14:07:47 -04:00
parent 67d5d008b9
commit df55ec0114
3 changed files with 23 additions and 19 deletions

8
netbox/generate_secret_key.py Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/python
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
import os
import random
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
random.seed = (os.urandom(2048))
print ''.join(random.choice(charset) for c in range(50))