Skip to content
Merged
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dev = [
"pytest-django",
"approvaltests",
"pytest-approvaltests",
"django-debug-toolbar>=6.3.0",
]

[tool.uv]
Expand Down
14 changes: 13 additions & 1 deletion server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os
import sys

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -92,6 +93,11 @@
"server.middleware.ResponseWarningHeaderMiddleware"
]

if DEBUG:
INSTALLED_APPS = [*INSTALLED_APPS, "debug_toolbar"]
MIDDLEWARE = ["debug_toolbar.middleware.DebugToolbarMiddleware", *MIDDLEWARE]


ROOT_URLCONF = "server.urls"

TEMPLATES = [
Expand Down Expand Up @@ -249,4 +255,10 @@
'operationsSorter': None,
'tagsSorter': None,
}
}
}

INTERNAL_IPS = [
# ...
"127.0.0.1",
# ...
]
5 changes: 3 additions & 2 deletions server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf.urls import include
from django.urls import path
from django.contrib import admin
from django.conf import settings
Expand All @@ -36,4 +35,6 @@
path('schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),]

if settings.DEBUG is True:
urlpatterns.append(path('admin/', admin.site.urls))
urlpatterns.append(path('admin/', admin.site.urls))
from debug_toolbar.toolbar import debug_toolbar_urls
urlpatterns += debug_toolbar_urls()
15 changes: 15 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.