File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
db.sqlite3
2
2
__pycache__ /
3
+ staticfiles /
4
+ .env /
5
+ venv /
Original file line number Diff line number Diff line change 128
128
]
129
129
130
130
STATIC_URL = "static/"
131
+ STATIC_ROOT = BASE_DIR / "hello_world" / "staticfiles"
132
+
133
+ MEDIA_URL = "media/"
134
+ MEDIA_ROOT = BASE_DIR / "hello_world" / "media"
135
+
131
136
132
137
# Default primary key field type
133
138
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
Original file line number Diff line number Diff line change 15
15
"""
16
16
from django .contrib import admin
17
17
from django .urls import path , include
18
+ from django .conf import settings
19
+ from django .conf .urls .static import static
18
20
19
21
from hello_world .core import views as core_views
20
22
23
25
path ("admin/" , admin .site .urls ),
24
26
path ("__reload__/" , include ("django_browser_reload.urls" )),
25
27
]
28
+ if settings .DEBUG :
29
+ urlpatterns += static (settings .MEDIA_URL , document_root = settings .MEDIA_ROOT )
30
+ urlpatterns += static (settings .STATIC_URL , document_root = settings .STATIC_ROOT )
You can’t perform that action at this time.
0 commit comments