ENH: Drop django-debug-toolbar, cleanup unused (#9)
This commit is contained in:
parent
0745af67a6
commit
5c69e774f9
6 changed files with 1 additions and 49 deletions
|
@ -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
|
|
|
@ -46,7 +46,6 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
||||||
# MIDDLEWARE CONFIGURATION
|
# MIDDLEWARE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
MIDDLEWARE = (
|
MIDDLEWARE = (
|
||||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
@ -128,8 +127,7 @@ TEMPLATES = [
|
||||||
'django.template.context_processors.static',
|
'django.template.context_processors.static',
|
||||||
'django.template.context_processors.tz',
|
'django.template.context_processors.tz',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'django.core.context_processors.request',
|
'django.template.context_processors.request',
|
||||||
'django.core.context_processors.request',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,23 +39,12 @@ EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
|
||||||
default='django.core.mail.backends.console.EmailBackend')
|
default='django.core.mail.backends.console.EmailBackend')
|
||||||
|
|
||||||
|
|
||||||
# django-debug-toolbar
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
MIDDLEWARE += ('ccdb.utils.middleware.PatchedDebugToolbarMiddleware',)
|
|
||||||
INSTALLED_APPS += ('debug_toolbar', )
|
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
INSTALLED_APPS += ('django_extensions',)
|
INSTALLED_APPS += ('django_extensions',)
|
||||||
|
|
||||||
INTERNAL_IPS = ('127.0.0.1', )
|
INTERNAL_IPS = ('127.0.0.1', )
|
||||||
|
|
||||||
DEBUG_TOOLBAR_CONFIG = {
|
|
||||||
'DISABLE_PANELS': [
|
|
||||||
'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
||||||
],
|
|
||||||
'SHOW_TEMPLATE_CONTEXT': True,
|
|
||||||
}
|
|
||||||
|
|
||||||
# TESTING
|
# TESTING
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -22,29 +22,6 @@ SECRET_KEY = env("DJANGO_SECRET_KEY")
|
||||||
# properly on Heroku.
|
# properly on Heroku.
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
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
|
# SITE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Hosts/domain names that are valid for this site
|
# Hosts/domain names that are valid for this site
|
||||||
|
|
|
@ -2,7 +2,6 @@ django==1.10
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
django-environ==0.4.0
|
django-environ==0.4.0
|
||||||
django-secure==1.0.1
|
|
||||||
whitenoise==3.2.1
|
whitenoise==3.2.1
|
||||||
|
|
||||||
# DB
|
# DB
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
-r base.txt
|
-r base.txt
|
||||||
|
|
||||||
Werkzeug==0.11.10
|
Werkzeug==0.11.10
|
||||||
django-debug-toolbar==1.5
|
|
||||||
django-extensions==1.7.1
|
django-extensions==1.7.1
|
||||||
flake8==3.0.4
|
flake8==3.0.4
|
||||||
pygraphviz==1.3.1
|
pygraphviz==1.3.1
|
||||||
|
|
Loading…
Add table
Reference in a new issue