From e3e64345fd5d77b43dd4067a1d7ae161d34f822d Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 29 Mar 2013 14:17:33 +0100 Subject: [PATCH] deploy: set secret_key on setup --- fnpdjango/deploy/__init__.py | 3 ++- fnpdjango/deploy/templates/localsettings.py.template | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fnpdjango/deploy/__init__.py b/fnpdjango/deploy/__init__.py index 41089bf..fb093f8 100644 --- a/fnpdjango/deploy/__init__.py +++ b/fnpdjango/deploy/__init__.py @@ -13,6 +13,7 @@ Then set up some env properties: """ from os.path import abspath, dirname, exists, join +from django.utils.crypto import get_random_string from fabric.api import * from fabric.contrib import files from fabric.tasks import Task, execute @@ -144,7 +145,7 @@ def upload_localsettings_sample(): template = '%(project_name)s/localsettings.py.template' if not exists(template): template = join(dirname(abspath(__file__)), 'templates/localsettings.py.template') - env.secret_key = '' # sth random + env.secret_key = get_random_string(50) files.upload_template(template, '%(app_path)s/localsettings.py.sample' % env, env) def upload_nginx_sample(): diff --git a/fnpdjango/deploy/templates/localsettings.py.template b/fnpdjango/deploy/templates/localsettings.py.template index 5f60b61..f0fa8b1 100644 --- a/fnpdjango/deploy/templates/localsettings.py.template +++ b/fnpdjango/deploy/templates/localsettings.py.template @@ -27,5 +27,7 @@ PIWIK_TOKEN = '' MEDIA_ROOT = '%(app_path)s/media/' STATIC_ROOT = '%(app_path)s/static/' -FNPDJANGO_REALIP = False -FNPDJANGO_XACCEL = False + +# Those should be set to True if you are behind Nginx. +FNPDJANGO_REALIP = True +FNPDJANGO_XACCEL = True -- 2.20.1