Skip to content

Instantly share code, notes, and snippets.

@sirodoht
Last active September 29, 2019 21:13
Show Gist options
  • Save sirodoht/3925a0bf4e187115dd13a7698892bec9 to your computer and use it in GitHub Desktop.
Save sirodoht/3925a0bf4e187115dd13a7698892bec9 to your computer and use it in GitHub Desktop.
Generating a SECRET_KEY for Django.
#!/usr/local/bin/python3
import random
secret_key = ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
print(secret_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment