forked from mozilla/addons-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdjdt_settings.py
32 lines (23 loc) · 1.01 KB
/
djdt_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# To enable the Django Debug Toolbar for local dev add the following line to
# your local_settings.py file:
# from djdt_settings import *
from settings import * # noqa
INSTALLED_APPS += (
'debug_toolbar',
)
DEBUG_TOOLBAR_PATCH_SETTINGS = False # Prevent DDT from patching the settings.
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
def debug_toolbar_enabled(request):
"""Callback used by the Django Debug Toolbar to decide when to display."""
# We want to make sure to have the DEBUG value at runtime, not the one we
# have in this specific settings file.
from django.conf import settings
return settings.DEBUG
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'settings.debug_toolbar_enabled',
'JQUERY_URL': '', # Use the jquery that's already on the page.
}
# Disable CSP by setting it as report only. We can't enable it because it uses
# "data:" for its logo, and it uses "unsafe eval" for some panels like the
# templates or SQL ones.
CSP_REPORT_ONLY = True