From a8f86ef882e3b78de9272de5b8c8eeb0dc40c432 Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Sun, 10 Jul 2022 14:45:21 +0300 Subject: [PATCH] Some changes from Pi --- dnd_db_site/settings.py | 5 +++++ dnd_db_site/urls.py | 4 +++- faerun_calendar/templates/faerun_calendar/index.html | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dnd_db_site/settings.py b/dnd_db_site/settings.py index 0a0512d..9f0b8f2 100644 --- a/dnd_db_site/settings.py +++ b/dnd_db_site/settings.py @@ -10,6 +10,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ +import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -118,6 +119,10 @@ USE_TZ = True # https://docs.djangoproject.com/en/4.0/howto/static-files/ STATIC_URL = 'static/' +STATIC_ROOT = '/home/ruslan/dnd-db-site.misc/static' +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static'), +] # Default primary key field type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field diff --git a/dnd_db_site/urls.py b/dnd_db_site/urls.py index eefedf1..5804ac6 100644 --- a/dnd_db_site/urls.py +++ b/dnd_db_site/urls.py @@ -15,8 +15,10 @@ Including another URLconf """ from django.contrib import admin from django.urls import include, path +from django.conf import settings +from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('', include('faerun_calendar.urls')), -] +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/faerun_calendar/templates/faerun_calendar/index.html b/faerun_calendar/templates/faerun_calendar/index.html index 21aa548..b19a774 100644 --- a/faerun_calendar/templates/faerun_calendar/index.html +++ b/faerun_calendar/templates/faerun_calendar/index.html @@ -1,6 +1,7 @@ + + {% load static %} -