Use tomllib instead of toml

This commit is contained in:
Edgar P. Burkhart 2023-11-25 10:44:57 +01:00
parent 3c1e4ac45d
commit 76ac6bc7fb
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 5 additions and 6 deletions

View File

@ -11,15 +11,14 @@ https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import os
import tomllib
from pathlib import Path
import toml
CONFIG_PATH = os.environ.get("NUMMI_CONFIG", None)
if CONFIG_PATH is None:
CONFIG = dict()
else:
CONFIG = toml.load(CONFIG_PATH)
CONFIG = dict()
if CONFIG_PATH is not None:
with Path(CONFIG_PATH).open("rb") as CONFIG_FILE:
CONFIG = tomllib.load(CONFIG_FILE)
# Build paths inside the project like this: BASE_DIR / 'subdir'.
MEDIA_CONF = CONFIG.get("media", {})