Add settings for file upload
This commit is contained in:
parent
4ada3dbc5d
commit
1512cae857
|
|
@ -1,4 +1,5 @@
|
|||
asgiref==3.5.2
|
||||
Django==4.1.4
|
||||
Pillow==9.4.0
|
||||
sqlparse==0.4.3
|
||||
tzdata==2022.7
|
||||
|
|
|
|||
|
|
@ -143,3 +143,6 @@ STATIC_URL = 'static/'
|
|||
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
||||
MEDIA_URL = 'media/'
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ Including another URLconf
|
|||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
|
|
@ -44,3 +46,5 @@ urlpatterns = [
|
|||
path('accounts/profile/', views.profile, name='profile'),
|
||||
path('accounts/', include('django.contrib.auth.urls')),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
|||
Loading…
Reference in a new issue