Minor fixes in settings/

- Typo
- Removes old comments
- Moves the template debug context processor back to the common file: it
  won't be loaded anyway if `DEBUG=False`.
- Ddt's middleware should be loaded first
This commit is contained in:
Martin Pépin 2017-04-15 11:09:16 +01:00
parent 40abe81402
commit ff73a635f8
2 changed files with 6 additions and 10 deletions

View file

@ -3,7 +3,7 @@
Django common settings for cof project.
Everything which is supposed to be identical between the production server and
the local development serveur should be here.
the local development server should be here.
"""
import os
@ -79,6 +79,7 @@ TEMPLATES = [
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
@ -118,10 +119,6 @@ USE_L10N = True
USE_TZ = True
# Media upload (through ImageField, SiteField)
# https://docs.djangoproject.com/en/1.9/ref/models/fields/
# Various additional settings
SITE_ID = 1

View file

@ -12,10 +12,6 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEBUG = True
TEMPLATES[0]["OPTIONS"]["context_processors"] += [
'django.template.context_processors.debug'
]
# ---
# Apache static/media config
@ -46,7 +42,10 @@ def show_toolbar(request):
return True
INSTALLED_APPS += ["debug_toolbar"]
MIDDLEWARE_CLASSES += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
MIDDLEWARE_CLASSES = (
["debug_toolbar.middleware.DebugToolbarMiddleware"]
+ MIDDLEWARE_CLASSES
)
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
}