SSL redirect
authorCharles Connell <charles@connells.org>
Mon, 19 May 2014 22:44:24 +0000 (18:44 -0400)
committerCharles Connell <charles@connells.org>
Mon, 19 May 2014 22:44:24 +0000 (18:44 -0400)
karmaworld/settings/prod.py
requirements.txt

index f167b7e00947a43f5a74af04d35908367344ba2e..5e2be529ebc2f60e83c7531e43a324fe17b79e6c 100644 (file)
@@ -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)
index a1bfb46fcd0b573ffd30e776491c7d89491c7779..51034b97bf7bc4b98358f8aadf7c7e570f63e791 100644 (file)
@@ -34,3 +34,4 @@ dj-database-url
 mock
 cssmin==0.1.4
 amqplib==1.0.2
+django-sslify>=0.2