-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
26 lines (22 loc) · 832 Bytes
/
config.py
File metadata and controls
26 lines (22 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from datetime import timedelta
from app.utils.secret_key import secret_key
class Config:
SECRET_KEY = secret_key()
SQLALCHEMY_DATABASE_URI = "sqlite:///main.db"
SQLALCHEMY_TRACK_MODIFICATIONS = False
PERMANENT_SESSION_LIFETIME = timedelta(days=7)
FLASK_HOST = os.getenv("FLASK_RUN_HOST", "0.0.0.0")
FLASK_PORT = int(os.getenv("FLASK_RUN_PORT", 8000))
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
LOG_FILE = os.getenv("LOG_FILE", "logs/app.log")
FLASK_DEBUG = os.getenv("FLASK_DEBUG", "False")
class TestingConfig(Config):
TESTING = True
FLASK_HOST = "localhost"
FLASK_PORT = 5000
SQLALCHEMY_DATABASE_URI = "sqlite:///test.db"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = "default_secret_key"
LOG_LEVEL = "DEBUG"
LOG_FILE = "logs/debug_app.log"