Skip to content

Instantly share code, notes, and snippets.

@AndreiHondrari
Last active January 4, 2021 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreiHondrari/10f77704846f33dcd73423b52ca8fe7e to your computer and use it in GitHub Desktop.
Save AndreiHondrari/10f77704846f33dcd73423b52ca8fe7e to your computer and use it in GitHub Desktop.
Useful python scripts
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