Skip to content

Commit

Permalink
Modified settings
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniDiazTech committed May 25, 2021
1 parent 918ee14 commit 8859244
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions config/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -43,6 +44,7 @@

# Custom apps
'photoapp',
'users',
]

MIDDLEWARE = [
Expand All @@ -60,7 +62,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -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'
11 changes: 9 additions & 2 deletions config/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8859244

Please sign in to comment.