33 lines
658 B
Python
33 lines
658 B
Python
![]() |
from pathlib import Path
|
||
|
|
||
|
|
||
|
class Config:
|
||
|
TESTING = False
|
||
|
DB_SERVER = "localhost"
|
||
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||
|
SRC_DIR = BASE_DIR / "app"
|
||
|
EXCLUDED_DIRS = ["__pycache__", "commands"]
|
||
|
|
||
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||
|
SQLALCHEMY_DATABASE_URI = f'sqlite:///{BASE_DIR / "db.sqlite"}'
|
||
|
|
||
|
|
||
|
class ProductionConfig(Config):
|
||
|
DB_SERVER = "0.0.0.0"
|
||
|
|
||
|
|
||
|
class DevelopmentConfig(Config):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class TestingConfig(Config):
|
||
|
TESTING = True
|
||
|
SQLALCHEMY_DATABASE_URI = "sqlite:///:memory:"
|
||
|
|
||
|
|
||
|
config = {
|
||
|
"development": DevelopmentConfig,
|
||
|
"production": ProductionConfig,
|
||
|
"testing": TestingConfig,
|
||
|
}
|