Use tomllib instead of toml
This commit is contained in:
parent
3c1e4ac45d
commit
76ac6bc7fb
1 changed files with 5 additions and 6 deletions
|
@ -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", {})
|
||||
|
|
Loading…
Reference in a new issue