From 8859244321b264bef174f109003ef955298660ac Mon Sep 17 00:00:00 2001 From: Daniel Diaz Date: Mon, 24 May 2021 23:29:30 -0500 Subject: [PATCH] Modified settings --- config/config/settings.py | 9 +++++++-- config/config/urls.py | 11 +++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/config/settings.py b/config/config/settings.py index 2f4b48a..d20b581 100644 --- a/config/config/settings.py +++ b/config/config/settings.py @@ -9,9 +9,10 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ - from pathlib import Path +from django.urls.conf import path + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -43,6 +44,7 @@ # Custom apps 'photoapp', + 'users', ] MIDDLEWARE = [ @@ -60,7 +62,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [BASE_DIR / 'templates'], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -137,3 +139,6 @@ # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +MEDIA_URL = '/media/' +MEDIA_ROOT = BASE_DIR / 'media' \ No newline at end of file diff --git a/config/config/urls.py b/config/config/urls.py index 697f733..2682720 100644 --- a/config/config/urls.py +++ b/config/config/urls.py @@ -14,9 +14,16 @@ 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ 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('', include('photoapp.urls')) -] + # Main app + path('', include('photoapp.urls')), + # Authentication + path('users/', include('users.urls')), +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file