Commit 3600e562 by David Ormsbee

Merge pull request #171 from edx/ormsbee/django_toolbar_settings_fix

Make django-debug-toolbar >= 1.0 work properly with syncdb and admin.
parents 281d22fd ba5a3c81
""" """
Dev-specific Django settings. Dev-specific Django settings.
""" """
# Inherit from base settings # Inherit from base settings
from .base import * from .base import *
INSTALLED_APPS += ( INSTALLED_APPS += (
'django_pdb', # Allows post-mortem debugging on exceptions 'django_pdb', # Allows post-mortem debugging on exceptions
'debug_panel',
'debug_toolbar', 'debug_toolbar',
'debug_panel',
) )
MIDDLEWARE_CLASSES += ( MIDDLEWARE_CLASSES += (
...@@ -16,20 +15,9 @@ MIDDLEWARE_CLASSES += ( ...@@ -16,20 +15,9 @@ MIDDLEWARE_CLASSES += (
'debug_panel.middleware.DebugPanelMiddleware', 'debug_panel.middleware.DebugPanelMiddleware',
) )
INTERNAL_IPS = ('127.0.0.1',) # We need to use explicit discovery or we'll have problems with syncdb and
# displaying the admin site. See:
CACHES = { # http://django-debug-toolbar.readthedocs.org/en/1.0/installation.html#explicit-setup
'default': { DEBUG_TOOLBAR_PATCH_SETTINGS = False
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'debug-panel',
},
# this cache backend will be used by django-debug-panel INTERNAL_IPS = ('127.0.0.1',)
'debug-panel': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'debug-panel',
'OPTIONS': {
'MAX_ENTRIES': 200
}
}
}
from django.conf import settings
from django.conf.urls import include, patterns, url from django.conf.urls import include, patterns, url
from django.contrib import admin from django.contrib import admin
...@@ -21,3 +22,13 @@ urlpatterns = patterns( ...@@ -21,3 +22,13 @@ urlpatterns = patterns(
# edx-tim apps # edx-tim apps
url(r'^peer/evaluations/', include(openassessment.assessment.urls)), url(r'^peer/evaluations/', include(openassessment.assessment.urls)),
) )
# We need to do explicit setup of the Django debug toolbar because autodiscovery
# causes problems when you mix debug toolbar >= 1.0 + django < 1.7, and the
# admin uses autodiscovery. See:
# http://django-debug-toolbar.readthedocs.org/en/1.0/installation.html#explicit-setup
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns('',
url(r'^__debug__/', include(debug_toolbar.urls)),
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment