1234567891011121314151617181920212223242526272829 |
- from flask.config import Config
- import os
- from dotenv import load_dotenv
- load_dotenv()
- START_YEAR = 2022
- SITE_TITLE = 'Агрегатор лекций ИСККОН'
- class DefaultConfig(Config):
- DEBUG = True
- PORT = int(os.environ["PORT"])
- HOST = os.environ["HOST"]
- DEVELOPMENT = True
- SECRET_KEY = 'do-i-really-need-this'
- FLASK_HTPASSWD_PATH = '/secret/.htpasswd'
- FLASK_SECRET = SECRET_KEY
- DB_HOST = 'database' # a docker link
- class ProductionConfig(DefaultConfig):
- DEVELOPMENT = False
- DEBUG = False
- DB_HOST = 'my.production.database' # not a docker link
- mode = os.environ["MODE"]
- config = ProductionConfig if mode == "prod" else DefaultConfig
|