Skip to content

Commit

Permalink
Add: Debug tool bar dev dep
Browse files Browse the repository at this point in the history
  • Loading branch information
Pythonusus committed Dec 12, 2024
1 parent b313ae8 commit b5f8a7f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ django-extensions = "^3.2.3"
[tool.poetry.group.dev.dependencies]
flake8 = "^7.1.1"
pylint = "^3.3.1"
django-debug-toolbar = "^4.4.6"

[build-system]
requires = ["poetry-core"]
Expand Down
6 changes: 6 additions & 0 deletions task_manager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

# Debug toolbar
if DEBUG:
INTERNAL_IPS = ['127.0.0.1']
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']
INSTALLED_APPS += ['debug_toolbar']
10 changes: 9 additions & 1 deletion task_manager/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""
from django.contrib import admin
from django.urls import path, include

from django.conf import settings
from task_manager import views

urlpatterns = [
Expand All @@ -29,3 +29,11 @@
path('tasks/', include('task_manager.tasks.urls')),
path('admin/', admin.site.urls),
]

# Debug toolbar
if settings.DEBUG:
import debug_toolbar

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

0 comments on commit b5f8a7f

Please sign in to comment.