mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-15 03:32:53 -06:00
Merge pull request #5677 from Alef-Burzmali/develop
Fix how SECRET_KEY is generated
This commit is contained in:
commit
08dfe64301
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
|
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
|
||||||
import random
|
import secrets
|
||||||
|
|
||||||
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
|
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
|
||||||
secure_random = random.SystemRandom()
|
print(''.join(secrets.choice(charset) for _ in range(50)))
|
||||||
print(''.join(secure_random.sample(charset, 50)))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user