mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
disable debug_toolbar by default
This commit is contained in:
parent
71cf8d5224
commit
d89034dcde
1 changed files with 24 additions and 18 deletions
|
@ -40,8 +40,7 @@ LOGOUT_REDIRECT_URL = '/'
|
||||||
PASSWORD_RESET_URL = '/accounts/password_reset/'
|
PASSWORD_RESET_URL = '/accounts/password_reset/'
|
||||||
APPEND_SLASH = True
|
APPEND_SLASH = True
|
||||||
|
|
||||||
DEBUG = True # DEBUG or ('--debug' in sys.argv)
|
DEBUG = DEBUG or ('--debug' in sys.argv)
|
||||||
DEBUG_TOOLBAR = True
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
|
@ -55,6 +54,29 @@ INSTALLED_APPS = [
|
||||||
|
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
MIDDLEWARE = [
|
||||||
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
AUTHENTICATION_BACKENDS = [
|
||||||
|
'django.contrib.auth.backends.ModelBackend',
|
||||||
|
]
|
||||||
|
|
||||||
|
DEBUG_TOOLBAR = False
|
||||||
|
if DEBUG:
|
||||||
|
try:
|
||||||
|
import debug_toolbar
|
||||||
|
DEBUG_TOOLBAR = True
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
if DEBUG_TOOLBAR:
|
if DEBUG_TOOLBAR:
|
||||||
INSTALLED_APPS = [*INSTALLED_APPS, 'debug_toolbar']
|
INSTALLED_APPS = [*INSTALLED_APPS, 'debug_toolbar']
|
||||||
INTERNAL_IPS = ['0.0.0.0', '127.0.0.1', '*']
|
INTERNAL_IPS = ['0.0.0.0', '127.0.0.1', '*']
|
||||||
|
@ -79,24 +101,8 @@ if DEBUG_TOOLBAR:
|
||||||
'debug_toolbar.panels.profiling.ProfilingPanel',
|
'debug_toolbar.panels.profiling.ProfilingPanel',
|
||||||
'djdt_flamegraph.FlamegraphPanel',
|
'djdt_flamegraph.FlamegraphPanel',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
MIDDLEWARE = [
|
|
||||||
'django.middleware.security.SecurityMiddleware',
|
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
||||||
'django.middleware.common.CommonMiddleware',
|
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
|
||||||
]
|
|
||||||
if DEBUG_TOOLBAR:
|
|
||||||
MIDDLEWARE = [*MIDDLEWARE, 'debug_toolbar.middleware.DebugToolbarMiddleware']
|
MIDDLEWARE = [*MIDDLEWARE, 'debug_toolbar.middleware.DebugToolbarMiddleware']
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = [
|
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
### Staticfile and Template Settings
|
### Staticfile and Template Settings
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue