Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial configuration of the debug-toolbar #47

Merged
merged 3 commits into from
Aug 12, 2023
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
5 changes: 5 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
]

THIRD_PARTY_APPS = [
"debug_toolbar",
"rest_framework",
]

Expand All @@ -45,6 +46,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"debug_toolbar.middleware.DebugToolbarMiddleware",
]

ROOT_URLCONF = "config.urls"
Expand Down Expand Up @@ -122,3 +124,6 @@
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

if DEBUG:
INTERNAL_IPS = ["127.0.0.1"]
9 changes: 8 additions & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from django.contrib import admin
from django.urls import path
from django.urls import include, path

from config.settings import DEBUG

urlpatterns = [
path("admin/", admin.site.urls),
]

if DEBUG:
import debug_toolbar

urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
Loading