Created
February 5, 2015 22:09
-
-
Save swinton/d44fde5d323473ce8be7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
""" | |
How Django generates SECRET_KEYs for new Django projects. | |
See: | |
https://github.com/django/django/blob/1.7.1/django/core/management/commands/startproject.py#L27 | |
""" | |
from django.utils.crypto import get_random_string | |
# Create a random secret_key | |
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)' | |
secret_key = get_random_string(50, chars) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment