Skip to content

Instantly share code, notes, and snippets.

@rub1cc
Forked from sandervm/commandline.txt
Last active June 3, 2019 14:23
Show Gist options
  • Save rub1cc/6d8480858e8e3d9fcedee785191d40e4 to your computer and use it in GitHub Desktop.
Save rub1cc/6d8480858e8e3d9fcedee785191d40e4 to your computer and use it in GitHub Desktop.
Generate Django secret key commandline

for python 2

python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'

for python 3 and above

python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment