Last active
January 4, 2021 14:42
-
-
Save AndreiHondrari/10f77704846f33dcd73423b52ca8fe7e to your computer and use it in GitHub Desktop.
Useful python scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import secrets | |
def generate_django_secret_key(length=50): | |
allowed_chars=( | |
'abcdefghijklmnopqrstuvwxyz' | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' | |
) | |
return ''.join(secrets.choice(allowed_chars) for i in range(length)) | |
if __name__ == "__main__": | |
print(generate_django_secret_key()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment