diff --git a/website/settings.py b/website/settings.py index 0046149..ade33e6 100644 --- a/website/settings.py +++ b/website/settings.py @@ -1,7 +1,7 @@ -import os +from pathlib import Path import environ -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +BASE_DIR = Path(__file__).parent.parent env = environ.Env( DEBUG=(bool, False), @@ -9,7 +9,7 @@ env = environ.Env( ) # Read local secrets -environ.Env.read_env(os.path.join(BASE_DIR, '.env')) +environ.Env.read_env(BASE_DIR / '.env') DEBUG = env('DEBUG') @@ -63,7 +63,7 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [ - os.path.join(BASE_DIR, "templates"), + BASE_DIR / "templates", ], "APP_DIRS": True, "OPTIONS": { @@ -107,15 +107,15 @@ STATICFILES_FINDERS = [ ] STATICFILES_DIRS = [ - os.path.join(BASE_DIR, "static", "build"), + BASE_DIR / "static" / "build", ] STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -STATIC_ROOT = os.path.join(BASE_DIR, "collected-static") +STATIC_ROOT = BASE_DIR / "collected-static" STATIC_URL = "/static/" -MEDIA_ROOT = os.path.join(BASE_DIR, "media") +MEDIA_ROOT = BASE_DIR / "media" MEDIA_URL = "/media/"