Add Django debug toolbar

This commit is contained in:
Skia 2017-02-24 01:52:22 +01:00
parent aa93211025
commit a4984317e9
3 changed files with 10 additions and 0 deletions

View File

@ -11,5 +11,6 @@ django-ajax-selects
reportlab
django-haystack
whoosh
django-debug-toolbar
# mysqlclient

View File

@ -481,3 +481,8 @@ try:
print("Custom settings imported")
except:
print("Custom settings failed")
if DEBUG:
INTERNAL_IPS = ['127.0.0.1']
INSTALLED_APPS += ("debug_toolbar",)
MIDDLEWARE_CLASSES = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE_CLASSES

View File

@ -49,4 +49,8 @@ urlpatterns = [
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]