From 618cd6018a3d3deef3b512b283c166dab4b291de Mon Sep 17 00:00:00 2001 From: Daniel Greenfeld Date: Sun, 18 Aug 2013 09:44:26 +0200 Subject: [PATCH] Fix authentication --- .../requirements/base.txt | 2 +- .../config/settings.py | 23 +++++------ .../templates/base.html | 39 +++++++------------ 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/{{cookiecutter.repo_name}}/requirements/base.txt b/{{cookiecutter.repo_name}}/requirements/base.txt index d375d659..d8598d62 100644 --- a/{{cookiecutter.repo_name}}/requirements/base.txt +++ b/{{cookiecutter.repo_name}}/requirements/base.txt @@ -27,7 +27,7 @@ https://bitbucket.org/andrewgodwin/south/get/59f6bae8b1a501ca14a5f23f8b11c44c42f # Useful things # django-avatar that work with Django 1.5+ -# git+git://github.com/jezdez/django-avatar@6393d25166a6c2d2df0bd28e19f161fac2bb1166 +git+git://github.com/jezdez/django-avatar@6393d25166a6c2d2df0bd28e19f161fac2bb1166 # django-crispy-forms with support for Bootstrap 3 diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py index 8503942a..69ca24ba 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py @@ -177,18 +177,19 @@ WSGI_APPLICATION = 'config.wsgi.application' ########## End URL Configuration ########## django-secure -INSTALLED_APPS += ("djangosecure", ) - -# set this to 60 seconds and then to 518400 when you can prove it works -SECURE_HSTS_SECONDS = 60 -SECURE_HSTS_INCLUDE_SUBDOMAINS = True -SECURE_FRAME_DENY = True -SECURE_CONTENT_TYPE_NOSNIFF = True -SECURE_BROWSER_XSS_FILTER = True -SESSION_COOKIE_SECURE = True -SESSION_COOKIE_HTTPONLY = True -SECURE_SSL_REDIRECT = True +SECURE = False +if SECURE: + INSTALLED_APPS += ("djangosecure", ) + # set this to 60 seconds and then to 518400 when you can prove it works + SECURE_HSTS_SECONDS = 60 + SECURE_HSTS_INCLUDE_SUBDOMAINS = True + SECURE_FRAME_DENY = True + SECURE_CONTENT_TYPE_NOSNIFF = True + SECURE_BROWSER_XSS_FILTER = True + SESSION_COOKIE_SECURE = True + SESSION_COOKIE_HTTPONLY = True + SECURE_SSL_REDIRECT = True ########## end django-secure diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html index 0b3324b4..94b0f2a8 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html @@ -26,37 +26,26 @@ -