Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,10 @@

# Cache time-to-live is 15 minutes
CACHE_TTL = 60 * 15


# DEBUG TOOLBAR
if DEBUG:
INTERNAL_IPS = ["127.0.0.1", "localhost"]
INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware")
7 changes: 7 additions & 0 deletions backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.contrib import admin
from django.urls import include, path
from drf_spectacular.views import (
Expand All @@ -40,3 +41,9 @@
name="redoc",
),
]


if settings.DEBUG:
from debug_toolbar.toolbar import debug_toolbar_urls

urlpatterns += debug_toolbar_urls()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ django-cors-headers==4.7.0
python-decouple==3.8
python-decouple-stubs==3.8.0.4
django-redis==6.0.0
django-debug-toolbar==6.0.0
Loading