forked from mirror/MrDoc
添加调试工具
This commit is contained in:
parent
4a7e67a837
commit
5db59b148a
@ -226,3 +226,20 @@ try:
|
||||
CHROMIUM_DRIVER_PATH = CONFIG['selenium']['driver_path']
|
||||
except:
|
||||
CHROMIUM_DRIVER_PATH = None
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1', '::1')
|
||||
# Django Debug Toolbar 工具,站点开启调试的时候启用
|
||||
try:
|
||||
import debug_toolbar.settings # noqa
|
||||
if DEBUG:
|
||||
INSTALLED_APPS.append('debug_toolbar.apps.DebugToolbarConfig')
|
||||
MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware')
|
||||
DEBUG_TOOLBAR_PATCH_SETTINGS = False
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
'JQUERY_URL': '',
|
||||
'DISABLE_PANELS': debug_toolbar.settings.PANELS_DEFAULTS,
|
||||
}
|
||||
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
@ -33,3 +33,10 @@ urlpatterns = [
|
||||
path('sitemap-<section>.xml', views.sitemap, {'sitemaps': sitemaps,'template_name':'sitemap/sitemap.xml'},
|
||||
name='django.contrib.sitemaps.views.sitemap') # 站点地图
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
try:
|
||||
import debug_toolbar
|
||||
urlpatterns.append(path('__debug__/', include(debug_toolbar.urls)))
|
||||
except ImportError:
|
||||
pass
|
Loading…
x
Reference in New Issue
Block a user