1
0
Fork 0

Add django-debug-toolbar

merge-requests/326/head
Nikos Roussos 2017-03-20 00:47:01 +02:00
parent b320e6c179
commit e7500421f7
No known key found for this signature in database
GPG Key ID: BADFF1767BA7C8E1
7 changed files with 42 additions and 6 deletions

View File

@ -35,7 +35,7 @@ BOWER_INSTALLED_APPS = (
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
# Middlware
MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',

View File

@ -9,3 +9,34 @@ DEBUG = True
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Enable debug-toolbar
INSTALLED_APPS += (
'debug_toolbar',
)
MIDDLEWARE += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
CSP_SCRIPT_SRC += (
'http://ajax.googleapis.com',
'data:',
)
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TEMPLATE_CONTEXT': True,
'SHOW_COLLAPSED': True
}
INTERNAL_IPS = ('127.0.0.1', )
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.profiling.ProfilingPanel',
]

View File

@ -1,5 +1,5 @@
import os
from base import * # flake8: noqa
from dev import * # flake8: noqa
ENVIRONMENT = 'dev'

View File

@ -4,11 +4,11 @@ from base import * # flake8: noqa
ENVIRONMENT = 'production'
# Opbeat
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
MIDDLEWARE += (
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
'opbeat.contrib.django.middleware.Opbeat404CatchMiddleware',
)
INSTALLED_APPS = INSTALLED_APPS + (
INSTALLED_APPS += (
'opbeat.contrib.django',
)

View File

@ -4,11 +4,11 @@ from base import * # flake8: noqa
ENVIRONMENT = 'stage'
# Opbeat
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
MIDDLEWARE += (
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
'opbeat.contrib.django.middleware.Opbeat404CatchMiddleware',
)
INSTALLED_APPS = INSTALLED_APPS + (
INSTALLED_APPS += (
'opbeat.contrib.django',
)

View File

@ -26,7 +26,9 @@ urlpatterns = [
]
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve,
{'document_root': settings.MEDIA_ROOT}),
url(r'^__debug__/', include(debug_toolbar.urls)),
]

View File

@ -29,6 +29,9 @@ docopts==0.6.1 \
--hash=sha256:ea8d6b03a0931c75a0e4919a0b0856f1c187c38a96174a750c86b41b903a693a
mock==2.0.0 \
--hash=sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1
django-debug-toolbar==1.7 \
--hash=sha256:89831c775d5317d47825c03426a04404a9042e23385039fbc14549ace8781107 \
--hash=sha256:bd929113ae22d7553c3ae6a6cb6762e8453784972eca06fa396aca47d0b66874
# Deps
configparser==3.5.0 \