No Description

run.py 499B

12345678910111213141516171819202122
  1. # -*- encoding: utf-8 -*-
  2. """
  3. License: MIT
  4. Copyright (c) 2019 - present AppSeed.us
  5. """
  6. from flask_migrate import Migrate
  7. from os import environ
  8. from sys import exit
  9. from config import config_dict
  10. from app import create_app, db
  11. get_config_mode = environ.get('APPSEED_CONFIG_MODE', 'Debug')
  12. try:
  13. config_mode = config_dict[get_config_mode.capitalize()]
  14. except KeyError:
  15. exit('Error: Invalid APPSEED_CONFIG_MODE environment variable entry.')
  16. app = create_app(config_mode)
  17. Migrate(app, db)