pdc_web.py
774 Bytes
"""
Flask app wrapper to be used by different callers
- with `flask run' invocation with FLASK_APP='pdc_web'
- inside pdc_web.wsgi as wsgi application in apache
- through uwsgi.ini for use with wsgi and nginx for example
"""
#
# Use app factory with configuration set by FLASK_ENV
# see app/__init_.py/create_app() for more details.
#
from app import create_app
pdc_app = create_app()
#
# Declare command line interpreter
# used with 'flask pdc_db' command
# see app/cli/__init__.py for more details.
#
from app.cli import bp as cli_bp
pdc_app.register_blueprint(cli_bp)
#
# Allow db migrations
#
# for help run
# flask db
# or just
# flask db upgrade
#
from app.models import db
from flask_migrate import Migrate
migrate = Migrate()
migrate.init_app(pdc_app, db)