diff --git a/ccdb/utils/middleware.py b/ccdb/utils/middleware.py deleted file mode 100644 index b197965..0000000 --- a/ccdb/utils/middleware.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.utils.deprecation import MiddlewareMixin -from django.conf import settings - - -if settings.DEBUG: - from debug_toolbar.middleware import DebugToolbarMiddleware - - class PatchedDebugToolbarMiddleware(MiddlewareMixin, - DebugToolbarMiddleware): - pass diff --git a/config/settings/base.py b/config/settings/base.py index f8bcaff..49d8a28 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -46,7 +46,6 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS # MIDDLEWARE CONFIGURATION # ------------------------------------------------------------------------------ MIDDLEWARE = ( - # Make sure djangosecure.middleware.SecurityMiddleware is listed first 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -128,8 +127,7 @@ TEMPLATES = [ 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.request', - 'django.core.context_processors.request', + 'django.template.context_processors.request', ], }, }, diff --git a/config/settings/local.py b/config/settings/local.py index 9959ff5..8e4907c 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -39,23 +39,12 @@ EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend') -# django-debug-toolbar -# ------------------------------------------------------------------------------ -MIDDLEWARE += ('ccdb.utils.middleware.PatchedDebugToolbarMiddleware',) -INSTALLED_APPS += ('debug_toolbar', ) - # Testing # ------------------------------------------------------------------------------ INSTALLED_APPS += ('django_extensions',) INTERNAL_IPS = ('127.0.0.1', ) -DEBUG_TOOLBAR_CONFIG = { - 'DISABLE_PANELS': [ - 'debug_toolbar.panels.redirects.RedirectsPanel', - ], - 'SHOW_TEMPLATE_CONTEXT': True, -} # TESTING # ------------------------------------------------------------------------------ diff --git a/config/settings/production.py b/config/settings/production.py index ed0b8ed..cff377c 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -22,29 +22,6 @@ SECRET_KEY = env("DJANGO_SECRET_KEY") # properly on Heroku. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') -# django-secure -# ------------------------------------------------------------------------------ -INSTALLED_APPS += ("djangosecure", ) - -SECURITY_MIDDLEWARE = ( - 'djangosecure.middleware.SecurityMiddleware', -) - -# Make sure djangosecure.middleware.SecurityMiddleware is listed first -MIDDLEWARE = SECURITY_MIDDLEWARE + MIDDLEWARE - -# set this to 60 seconds and then to 518400 when you can prove it works -SECURE_HSTS_SECONDS = 60 -SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool( - "DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS", default=True) -SECURE_FRAME_DENY = env.bool("DJANGO_SECURE_FRAME_DENY", default=True) -SECURE_CONTENT_TYPE_NOSNIFF = env.bool( - "DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True) -SECURE_BROWSER_XSS_FILTER = True -SESSION_COOKIE_SECURE = False -SESSION_COOKIE_HTTPONLY = True -SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True) - # SITE CONFIGURATION # ------------------------------------------------------------------------------ # Hosts/domain names that are valid for this site diff --git a/requirements/base.txt b/requirements/base.txt index 6619ebc..cd342be 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -2,7 +2,6 @@ django==1.10 # Configuration django-environ==0.4.0 -django-secure==1.0.1 whitenoise==3.2.1 # DB diff --git a/requirements/local.txt b/requirements/local.txt index cfc0f6e..397bd7b 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -1,7 +1,6 @@ -r base.txt Werkzeug==0.11.10 -django-debug-toolbar==1.5 django-extensions==1.7.1 flake8==3.0.4 pygraphviz==1.3.1