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.
45 lines
1.2 KiB
Django/Jinja
45 lines
1.2 KiB
Django/Jinja
from pathlib import Path
|
|
|
|
from iti.config import BaseConfig, DevConfig as BaseDevConfig, ProdConfig as BaseProdConfig
|
|
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent
|
|
|
|
|
|
class DevConfig(BaseDevConfig):
|
|
def __init__(self) -> None:
|
|
super().__init__()
|
|
self.app_name = "{{ project_name }}"
|
|
self.base_dir = BASE_DIR
|
|
self.file_storage["LOCAL"]["base_path"] = str(BASE_DIR / "runtime" / "uploads")
|
|
self.log_dir = str(BASE_DIR / "runtime" / "logs")
|
|
|
|
|
|
class TestConfig(BaseConfig):
|
|
def __init__(self) -> None:
|
|
super().__init__(
|
|
app_name="{{ project_name }}",
|
|
app_env="test",
|
|
testing=True,
|
|
database_url="sqlite+pysqlite:///:memory:",
|
|
base_dir=BASE_DIR,
|
|
ratelimit_enabled=False,
|
|
log_file_enabled=False,
|
|
)
|
|
|
|
|
|
class ProdConfig(BaseProdConfig):
|
|
def __init__(self) -> None:
|
|
super().__init__()
|
|
self.app_name = "{{ project_name }}"
|
|
self.base_dir = BASE_DIR
|
|
self.log_dir = str(BASE_DIR / "runtime" / "logs")
|
|
|
|
|
|
config = {
|
|
"dev": DevConfig,
|
|
"test": TestConfig,
|
|
"prod": ProdConfig,
|
|
"default": DevConfig,
|
|
}
|