tptimer/config.py

22 lines
551 B
Python
Raw Normal View History

2018-07-20 05:43:02 +00:00
import os
2023-07-14 06:17:02 +00:00
from dotenv import load_dotenv
__ALREADY_IMPORTED = False
if not __ALREADY_IMPORTED:
load_dotenv()
__ALREADY_IMPORTED = True
2018-07-20 05:43:02 +00:00
class Config(object):
2023-07-14 06:17:02 +00:00
if not os.getenv("secret_key"):
raise Exception("Must be setted the 'secret_key' env var")
2018-07-20 05:43:02 +00:00
SECRET_KEY=os.getenv("secret_key")
class DevelopmentConfig(Config):
DEBUG=True
2023-07-14 06:17:02 +00:00
if not os.getenv("sql_uri"):
raise Exception("Must be setted the 'sql_url' env var")
2018-07-20 05:43:02 +00:00
SQLALCHEMY_DATABASE_URI = os.getenv("sql_uri")
SQLALCHEMY_TRACK_MODIFICATIONS = False