forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-local_settings
60 lines (48 loc) · 2.11 KB
/
template-local_settings
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# local_settings.py
# this file will be included by settings.py *after* loading settings.dist.py
# this example configures the django debug toolbar and sets some loglevels to DEBUG
from django.conf.urls import include, url
# UPDATE: Adding debug_toolbar to to INSTALLED_APPS here prevents the nginx container from generating the correct static files
# So add debug_toolbar to INSTALLED_APPS in settings.dist.py and rebuild to get started with the debug_toolbar.
# Thje middleware and other config can remain in this file (local_settings.py) to avoid chance of conflicts on upgrades.
INSTALLED_APPS += (
# 'debug_toolbar',
)
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
] + MIDDLEWARE
# adding DEBUG logging for all of Django.
LOGGING['loggers']['root'] = {
'handlers': ['console'],
'level': 'DEBUG',
}
# setting log level WARN for defect dojo
# LOGGING['loggers']['dojo']['level'] = 'WARN'
# output DEBUG logging for deduplication
# LOGGING['loggers']['dojo.specific-loggers.deduplication']['level'] = 'DEBUG'
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": show_toolbar,
"INTERCEPT_REDIRECTS": False,
"SHOW_COLLAPSED": True,
}
DEBUG_TOOLBAR_PANELS = [
# 'ddt_request_history.panels.request_history.RequestHistoryPanel', # Here it is
'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.templates.TemplatesPanel',
# 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
'debug_toolbar.panels.profiling.ProfilingPanel',
# 'cachalot.panels.CachalotPanel',
]
import debug_toolbar
EXTRA_URL_PATTERNS = [url(r"^__debug__/", include(debug_toolbar.urls))]