Refactor static file settings to use configuration for STATIC_ROOT
This commit is contained in:
parent
0e0da7f658
commit
530e6eaf47
1 changed files with 2 additions and 1 deletions
|
@ -22,6 +22,7 @@ if CONFIG_PATH is not None:
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
MEDIA_CONF = CONFIG.get("media", {})
|
MEDIA_CONF = CONFIG.get("media", {})
|
||||||
|
STATIC_CONF = CONFIG.get("static", {})
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
MEDIA_ROOT = Path(MEDIA_CONF.get("root", "/var/lib/nummi"))
|
MEDIA_ROOT = Path(MEDIA_CONF.get("root", "/var/lib/nummi"))
|
||||||
MEDIA_URL = "media/"
|
MEDIA_URL = "media/"
|
||||||
|
@ -124,7 +125,7 @@ USE_TZ = True
|
||||||
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = "static/"
|
STATIC_URL = "static/"
|
||||||
STATIC_ROOT = "/srv/nummi"
|
STATIC_ROOT = STATIC_CONF.get("root", "/srv/nummi")
|
||||||
LOGIN_URL = "login"
|
LOGIN_URL = "login"
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue