Add settings for file upload

This commit is contained in:
Benjamin 2023-03-24 14:21:14 +01:00
parent 4ada3dbc5d
commit 1512cae857
3 changed files with 8 additions and 0 deletions

View file

@ -1,4 +1,5 @@
asgiref==3.5.2
Django==4.1.4
Pillow==9.4.0
sqlparse==0.4.3
tzdata==2022.7

View file

@ -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/'

View file

@ -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)