From e1ce83b1c9c1b06c19584dbd1c927ed21c7cc1a1 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Mon, 19 May 2014 18:44:24 -0400 Subject: [PATCH] SSL redirect --- karmaworld/settings/prod.py | 5 ++++- requirements.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/karmaworld/settings/prod.py b/karmaworld/settings/prod.py index f167b7e..5e2be52 100644 --- a/karmaworld/settings/prod.py +++ b/karmaworld/settings/prod.py @@ -105,6 +105,7 @@ CELERY_TIMEZONE = 'UTC' INSTALLED_APPS += ( 'storages', 'gunicorn', + 'sslify', ) # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings @@ -133,6 +134,9 @@ STATIC_URL = '//' + os.environ['CLOUDFRONT_DOMAIN'] + '/' + AWS_LOCATION + '/' ########## SSL FORWARDING CONFIGURATION SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') +MIDDLEWARE_CLASSES = ( + 'sslify.middleware.SSLifyMiddleware', +) + MIDDLEWARE_CLASSES ########## END SSL FORWARDING CONFIGURATION ########## COMPRESSION CONFIGURATION @@ -163,7 +167,6 @@ COMPRESS_JS_FILTERS += [ AWS_QUERYSTRING_EXPIRE = 60 * 60 * 24 * 365 * 10 ########## END COMPRESSION CONFIGURATION - ########## SECRET CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = environ.get('SECRET_KEY', SECRET_KEY) diff --git a/requirements.txt b/requirements.txt index a1bfb46..51034b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,3 +34,4 @@ dj-database-url mock cssmin==0.1.4 amqplib==1.0.2 +django-sslify>=0.2 -- 2.25.1