mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
feat(settings): WEBVIRTCLOUD_DEBUG=1 turns on Django's debug mode
DEBUG was fixed to False in the template, and Docker builds settings.py from it in each container: debug mode could only be had by editing the file inside a running container. It is now read from the environment like the other options; off unless the variable is 1. The toolbar's URLs follow settings-dev, which installs the toolbar, not DEBUG: with the dev packages present, DEBUG alone imported them without the app and every URL lookup failed.
This commit is contained in:
parent
aead17dc32
commit
a8fce405b3
4 changed files with 18 additions and 10 deletions
|
|
@ -43,13 +43,9 @@ urlpatterns = [
|
|||
re_path(r"^api/(?:.*/)?$", api_not_found),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
try:
|
||||
import debug_toolbar
|
||||
# settings-dev installs the toolbar; WEBVIRTCLOUD_DEBUG alone does not
|
||||
if "debug_toolbar" in settings.INSTALLED_APPS:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns += [
|
||||
path("__debug__/", include(debug_toolbar.urls)),
|
||||
]
|
||||
except ImportError:
|
||||
pass
|
||||
urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue