diff --git a/src/website/settings.py b/src/website/settings.py index 839941d..0bc71fd 100644 --- a/src/website/settings.py +++ b/src/website/settings.py @@ -10,8 +10,8 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/6.0/ref/settings/ """ -from pathlib import Path import os +from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -24,7 +24,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.environ["DJANGO_SECRET_KEY"] # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.getenv("DEBUG") == "TRUE" +DEBUG = os.getenv("DEBUG", "false") == "true" ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "127.0.0.1").split(",") @@ -34,6 +34,7 @@ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") INSTALLED_APPS = [ "polls.apps.PollsConfig", + "core.apps.CoreConfig", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", @@ -53,7 +54,7 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -if os.getenv("DJANGO_RELOAD", "False") == "True": +if os.getenv("DJANGO_RELOAD", "false") == "true": INSTALLED_APPS.append("django_browser_reload") INSTALLED_APPS.append("django_watchfiles") MIDDLEWARE.append("django_browser_reload.middleware.BrowserReloadMiddleware") @@ -63,7 +64,7 @@ ROOT_URLCONF = "website.urls" TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": [BASE_DIR / "templates"], "APP_DIRS": True, "OPTIONS": { "context_processors": [ @@ -129,3 +130,7 @@ USE_TZ = True STATIC_ROOT = "/app/static/" STATIC_URL = "static/" + +STATICFILES_DIRS = [ + BASE_DIR / "static", +]