Update settings to use pathlib
This commit is contained in:
parent
c1fdd81f86
commit
b195ae2a62
1 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
import os
|
from pathlib import Path
|
||||||
import environ
|
import environ
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = Path(__file__).parent.parent
|
||||||
|
|
||||||
env = environ.Env(
|
env = environ.Env(
|
||||||
DEBUG=(bool, False),
|
DEBUG=(bool, False),
|
||||||
|
@ -9,7 +9,7 @@ env = environ.Env(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Read local secrets
|
# Read local secrets
|
||||||
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))
|
environ.Env.read_env(BASE_DIR / '.env')
|
||||||
|
|
||||||
DEBUG = env('DEBUG')
|
DEBUG = env('DEBUG')
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ TEMPLATES = [
|
||||||
{
|
{
|
||||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
"DIRS": [
|
"DIRS": [
|
||||||
os.path.join(BASE_DIR, "templates"),
|
BASE_DIR / "templates",
|
||||||
],
|
],
|
||||||
"APP_DIRS": True,
|
"APP_DIRS": True,
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
|
@ -107,15 +107,15 @@ STATICFILES_FINDERS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
os.path.join(BASE_DIR, "static", "build"),
|
BASE_DIR / "static" / "build",
|
||||||
]
|
]
|
||||||
|
|
||||||
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
||||||
|
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, "collected-static")
|
STATIC_ROOT = BASE_DIR / "collected-static"
|
||||||
STATIC_URL = "/static/"
|
STATIC_URL = "/static/"
|
||||||
|
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
MEDIA_ROOT = BASE_DIR / "media"
|
||||||
MEDIA_URL = "/media/"
|
MEDIA_URL = "/media/"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue