Skip to content

Commit

Permalink
feat: add option to specify config by env var TODO_CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
jakuboskera committed Jun 18, 2023
1 parent 6d74b6b commit 6c439e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@
from app import create_app
from app import db
from settings import config_dict
from os import environ

CONFIG = "dev" if get_debug_flag() else "prod"

CONFIG = ""
config = environ.get("TODO_CONFIG", "")
if config != "" and config in config_dict:
CONFIG = config
else:
CONFIG = "dev" if get_debug_flag() else "prod"

app = create_app(config_dict[CONFIG])
migrate = Migrate(app, db)

0 comments on commit 6c439e3

Please sign in to comment.