Use toml python package to support python3.10
This commit is contained in:
parent
21da8a41ec
commit
1aaafc01e2
2 changed files with 4 additions and 3 deletions
1
PKGBUILD
1
PKGBUILD
|
@ -9,6 +9,7 @@ depends=(
|
||||||
"gunicorn"
|
"gunicorn"
|
||||||
"python-django"
|
"python-django"
|
||||||
"python-matplotlib"
|
"python-matplotlib"
|
||||||
|
"python-toml"
|
||||||
)
|
)
|
||||||
makedepends=("git")
|
makedepends=("git")
|
||||||
optdepends=("postgresql: database")
|
optdepends=("postgresql: database")
|
||||||
|
|
|
@ -10,16 +10,16 @@ For the full list of settings and their values, see
|
||||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import tomllib
|
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import toml
|
||||||
|
|
||||||
CONFIG_PATH = os.environ.get("NUMMI_CONFIG", None)
|
CONFIG_PATH = os.environ.get("NUMMI_CONFIG", None)
|
||||||
if CONFIG_PATH is None:
|
if CONFIG_PATH is None:
|
||||||
CONFIG = dict()
|
CONFIG = dict()
|
||||||
else:
|
else:
|
||||||
with open(CONFIG_PATH, "rb") as CONFIG_FILE:
|
CONFIG = toml.load(CONFIG_PATH)
|
||||||
CONFIG = tomllib.load(CONFIG_FILE)
|
|
||||||
|
|
||||||
# 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", {})
|
||||||
|
|
Loading…
Reference in a new issue