From 9b4eed6383bd74f8580b0d835703319a21672f72 Mon Sep 17 00:00:00 2001 From: brianach <> Date: Wed, 13 Dec 2023 21:37:38 +0000 Subject: [PATCH] add media and styling static dirs, static settings and urls --- fmci_store/settings.py | 6 ++++++ fmci_store/urls.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fmci_store/settings.py b/fmci_store/settings.py index 8535825..67705cc 100644 --- a/fmci_store/settings.py +++ b/fmci_store/settings.py @@ -152,3 +152,9 @@ # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +STATIC_URL = '/static/' +STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),) + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') \ No newline at end of file diff --git a/fmci_store/urls.py b/fmci_store/urls.py index 6cfedab..ed7e5fc 100644 --- a/fmci_store/urls.py +++ b/fmci_store/urls.py @@ -15,9 +15,11 @@ """ from django.contrib import admin from django.urls import path, include +from django.conf import settings +from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path('', include('home.urls')), -] +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file