File tree Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,15 @@ python manage.py createsuperuser
59
59
60
60
---
61
61
62
- 6 . Finally, run start the development server
62
+ 6 . Create a ` .env ` file in the project root directory and add the following environment variables:
63
+
64
+ ```
65
+ DJANGO_SECRET_KEY=your_secret_key
66
+ ```
67
+
68
+ ---
69
+
70
+ 7 . Finally, run start the development server
63
71
``` bash
64
72
python manage.py runserver
65
73
```
Original file line number Diff line number Diff line change 43
43
"django.contrib.staticfiles" ,
44
44
"django_bootstrap5" ,
45
45
"django_extensions" ,
46
+ 'debug_toolbar' ,
46
47
47
48
# apps created by FA:
48
49
59
60
"django.contrib.auth.middleware.AuthenticationMiddleware" ,
60
61
"django.contrib.messages.middleware.MessageMiddleware" ,
61
62
"django.middleware.clickjacking.XFrameOptionsMiddleware" ,
63
+ 'debug_toolbar.middleware.DebugToolbarMiddleware'
62
64
]
63
65
64
66
ROOT_URLCONF = "SORT.urls"
163
165
'django.contrib.auth.backends.ModelBackend' ,
164
166
)
165
167
168
+ # For django-debug-toolbar
169
+ INTERNAL_IPS = [
170
+ # ...
171
+ "127.0.0.1" ,
172
+ # ...
173
+ ]
166
174
167
175
# FA: for production:
168
176
169
177
#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
178
+
Original file line number Diff line number Diff line change 14
14
1. Import the include() function: from django.urls import include, path
15
15
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16
16
"""
17
+ from django .conf import settings
17
18
from django .contrib import admin
18
19
from django .urls import path , include
19
20
20
21
urlpatterns = [
21
22
path ("admin/" , admin .site .urls ),
22
23
path ("" , include ("home.urls" )),
23
24
]
25
+
26
+ if settings .DEBUG :
27
+ import debug_toolbar
28
+ urlpatterns += [
29
+ path ('__debug__/' , include (debug_toolbar .urls )),
30
+ ]
Original file line number Diff line number Diff line change @@ -24,3 +24,4 @@ traitlets==5.14.3
24
24
typing_extensions == 4.12.2
25
25
tzdata == 2024.1
26
26
wcwidth == 0.2.13
27
+ django_debug_toolbar == 4.4.6
You can’t perform that action at this time.
0 commit comments