Browse Source

add django dubug toolbar

subDesTagesMitExtraKaese 2 years ago
parent
commit
6101f591b0
3 changed files with 5 additions and 1 deletions
  1. 2 0
      project/settings.py
  2. 1 0
      project/urls.py
  3. 2 1
      requirements.txt

+ 2 - 0
project/settings.py

@@ -45,6 +45,7 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'debug_toolbar',
 ]
 
 MIDDLEWARE = [
@@ -56,6 +57,7 @@ MIDDLEWARE = [
     'django.middleware.locale.LocaleMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    "debug_toolbar.middleware.DebugToolbarMiddleware",
 ]
 
 LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), )

+ 1 - 0
project/urls.py

@@ -20,4 +20,5 @@ from zitap import views
 urlpatterns = [
     path('admin/', admin.site.urls),
     path('', include('zitap.urls')),
+    path('__debug__/', include('debug_toolbar.urls')),
 ]

+ 2 - 1
requirements.txt

@@ -1,3 +1,4 @@
 django
 mysqlclient
-gunicorn
+gunicorn
+django-debug-toolbar