Skip to content

Commit

Permalink
Add django debug toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcen committed Apr 1, 2024
1 parent 41e939d commit f525c18
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions django/myproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
ALLOWED_HOSTS = ["localhost"] + env("ALLOWED_HOSTS").split(",")
CSRF_TRUSTED_ORIGINS = env("CSRF_TRUSTED_ORIGINS").split(",")

INTERNAL_IPS = [
# "127.0.0.1",
]

# Application definition

Expand All @@ -62,11 +65,14 @@
"simple_history",
# Include extras to make working with Django's CLI etc easier
"django_extensions",
# Helps with debugging. Only enabled if client is listed in INTERNAL_IPS
"debug_toolbar",
# Uncomment the below line and replace 'myapp' with the name of your app
#'myapp',
]

MIDDLEWARE = [
"debug_toolbar.middleware.DebugToolbarMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
Expand Down
1 change: 1 addition & 0 deletions django/myproject/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
name="password_reset_complete",
),
path("admin/", admin.site.urls),
path("__debug__/", include("debug_toolbar.urls")),
# Add this to set up authentication for REST framework
# path('api-auth/', include('rest_framework.urls')),
# To set up your first app to manage the homepage of this site,
Expand Down
2 changes: 2 additions & 0 deletions django/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ django-bootstrap5
gunicorn
django-extensions
ipython
setuptools # required by django-simple-history
django-debug-toolbar
7 changes: 6 additions & 1 deletion django/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ django==4.2.2
# via
# -r django/requirements.in
# django-bootstrap5
# django-debug-toolbar
# django-extensions
# djangorestframework
django-bootstrap5==23.3
# via -r django/requirements.in
django-debug-toolbar==4.3.0
# via -r django/requirements.in
django-environ==0.10.0
# via -r django/requirements.in
django-extensions==3.2.3
Expand Down Expand Up @@ -57,7 +60,9 @@ pytz==2023.3
six==1.16.0
# via asttokens
sqlparse==0.4.4
# via django
# via
# django
# django-debug-toolbar
stack-data==0.6.3
# via ipython
traitlets==5.13.0
Expand Down

0 comments on commit f525c18

Please sign in to comment.