mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
b6e532f01d
Use secrets.choice instead of random.sample to generate the secret key.
7 lines
277 B
Python
Executable File
7 lines
277 B
Python
Executable File
#!/usr/bin/env python
|
|
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
|
|
import secrets
|
|
|
|
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
|
|
print(''.join(secrets.choice(charset) for _ in range(50)))
|