Logo
Explore Help
Register Sign In
External/netbox
1
0
Fork 0
You've already forked netbox
mirror of https://github.com/netbox-community/netbox.git synced 2025-12-20 19:26:37 +00:00
Code Issues Packages Projects Releases Wiki Activity
netbox/netbox/generate_secret_key.py

7 lines
277 B
Python
Raw Normal View History

Basic Support for Python 3 (#827) * Rudimentary python3 support * update docs and trigger Travis * fix some of the tests * fix all python3 errors * change env calls to just python * add @python_2_unicode_compatible decorator to models for python2 compatibility * switch netbox.configuration to from netbox import configuration
2017-01-23 22:44:29 +01:00
#!/usr/bin/env python
Introduced a script to generate SECRET_KEY; removed example SECRET_KEY
2016-06-21 14:07:47 -04:00
# This script will generate a random 50-character string suitable for use as a SECRET_KEY.
Fix how SECRET_KEY is generated Use secrets.choice instead of random.sample to generate the secret key.
2021-01-24 21:20:55 +01:00
import secrets
Introduced a script to generate SECRET_KEY; removed example SECRET_KEY
2016-06-21 14:07:47 -04:00
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
Fix how SECRET_KEY is generated Use secrets.choice instead of random.sample to generate the secret key.
2021-01-24 21:20:55 +01:00
print(''.join(secrets.choice(charset) for _ in range(50)))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 336ms Template: 11ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API