mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 07:34:27 -04:00
only enable debug toolbar if nothreading is on
This commit is contained in:
parent
ca2bb673ea
commit
c257ae240e
1 changed files with 4 additions and 3 deletions
|
@ -65,13 +65,14 @@ AUTHENTICATION_BACKENDS = [
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
]
|
]
|
||||||
|
|
||||||
DEBUG_TOOLBAR = False
|
# only enable debug toolbar when in DEBUG mode with --nothreading (it doesnt work in multithreaded mode)
|
||||||
if DEBUG:
|
DEBUG_TOOLBAR = DEBUG and ('--nothreading' in sys.argv) and ('--reload' not in sys.argv)
|
||||||
|
if DEBUG_TOOLBAR:
|
||||||
try:
|
try:
|
||||||
import debug_toolbar # noqa
|
import debug_toolbar # noqa
|
||||||
DEBUG_TOOLBAR = True
|
DEBUG_TOOLBAR = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
DEBUG_TOOLBAR = False
|
||||||
|
|
||||||
if DEBUG_TOOLBAR:
|
if DEBUG_TOOLBAR:
|
||||||
INSTALLED_APPS = [*INSTALLED_APPS, 'debug_toolbar']
|
INSTALLED_APPS = [*INSTALLED_APPS, 'debug_toolbar']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue