Wednesday, April 30, 2008

Django SECRET_KEY Generation

When deploying Django application it is a common step to generate a SECRET_KEY for the site. Here is the quick recipe to do it:


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


Useful when for whatever reason you don't want to install django-command-extensions.

0 comments: