You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
888 B
Django/Jinja
39 lines
888 B
Django/Jinja
from pathlib import Path
|
|
|
|
from iti.config import DevConfig as BaseDevConfig
|
|
from iti.config import ProdConfig as BaseProdConfig
|
|
from iti.config import TestConfig as BaseTestConfig
|
|
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent
|
|
|
|
|
|
class DevConfig(BaseDevConfig):
|
|
BASE_DIR = BASE_DIR
|
|
SQLALCHEMY_DATABASE_URI = f"sqlite:///{BASE_DIR / 'runtime' / '{{ project_slug }}_dev.db'}"
|
|
FILE_STORAGE = {
|
|
**BaseDevConfig.FILE_STORAGE,
|
|
"LOCAL": {
|
|
**BaseDevConfig.FILE_STORAGE.get("LOCAL", {}),
|
|
"base_path": str(BASE_DIR / "runtime" / "uploads"),
|
|
},
|
|
}
|
|
|
|
|
|
class TestConfig(BaseTestConfig):
|
|
BASE_DIR = BASE_DIR
|
|
SQLALCHEMY_DATABASE_URI = "sqlite:///:memory:"
|
|
|
|
|
|
class ProdConfig(BaseProdConfig):
|
|
BASE_DIR = BASE_DIR
|
|
pass
|
|
|
|
|
|
config = {
|
|
"dev": DevConfig,
|
|
"test": TestConfig,
|
|
"prod": ProdConfig,
|
|
"default": DevConfig,
|
|
}
|