Merge branch 'secret-secret-key' of https://github.com/Dunedan/binder into Dunedan-secret-secret-key
This commit is contained in:
commit
cbd0716c8f
|
@ -4,3 +4,4 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
*.conf
|
*.conf
|
||||||
*~
|
*~
|
||||||
|
/binder/secret.txt
|
||||||
|
|
|
@ -42,7 +42,18 @@ MEDIA_ROOT = os.path.join(SITE_ROOT, "files")
|
||||||
MEDIA_URL = "/files/"
|
MEDIA_URL = "/files/"
|
||||||
STATIC_URL= "/static/"
|
STATIC_URL= "/static/"
|
||||||
|
|
||||||
SECRET_KEY = 'iuo-zka8nnv0o+b*7#_*fcep$@f^35=)c#7_20z6i8g0oc&r!g'
|
SECRET_FILE = os.path.join(SITE_ROOT, 'secret.txt')
|
||||||
|
try:
|
||||||
|
SECRET_KEY = open(SECRET_FILE).read().strip()
|
||||||
|
except IOError:
|
||||||
|
try:
|
||||||
|
from random import choice
|
||||||
|
SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
|
||||||
|
secret = file(SECRET_FILE, 'w')
|
||||||
|
secret.write(SECRET_KEY)
|
||||||
|
secret.close()
|
||||||
|
except IOError:
|
||||||
|
Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)
|
||||||
|
|
||||||
# List of callables that know how to import templates from various sources.
|
# List of callables that know how to import templates from various sources.
|
||||||
TEMPLATE_LOADERS = (
|
TEMPLATE_LOADERS = (
|
||||||
|
|
Loading…
Reference in New Issue