fix: debug toolbar import error when running on production setting with DEBUG on (#3085)
This commit is contained in:
parent
361ee16567
commit
1795916042
1 changed files with 7 additions and 4 deletions
|
|
@ -19,8 +19,11 @@ urlpatterns = [
|
||||||
|
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import debug_toolbar
|
try:
|
||||||
|
import debug_toolbar
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
re_path(r"^__debug__/", include(debug_toolbar.urls)),
|
re_path(r"^__debug__/", include(debug_toolbar.urls)),
|
||||||
] + urlpatterns
|
] + urlpatterns
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue