itplanning/ITPlanning/config.py
2021-05-25 21:01:20 +02:00

28 lines
563 B
Python

""" config management """
from os import makedirs, path
import tempfile
current_config = None
class DefaultConfig:
DEBUG = False
SECRET_KEY="toto"
tempdir= path.join(tempfile.gettempdir(), "ITPlanning")
BASE = {
"database_uri": "sqlite:///" + path.join(tempdir, "ITPlanning.db"),
}
def __init__(self):
if not path.exists(self.tempdir):
makedirs(self.tempdir)
current_config = self
def get_current_config():
if current_config is None:
DefaultConfig()
return current_config