Blame view

pdc_web.py 779 Bytes
6b1ff46a   hitier   Better module doc...
1
2
3
4
5
6
"""
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
"""
14c3e74c   hitier   Move cli register...
7

3122f2f8   hitier   Running mode 1: f...
8
9
10
11
#
# Use app factory with configuration set by FLASK_ENV
# see app/__init_.py/create_app() for more details.
#
aea0ff9e   hitier   Tiny code reformat
12
from app import create_app
3122f2f8   hitier   Running mode 1: f...
13
pdc_app = create_app()
508144eb   hitier   Add cli pattern
14
15
16

#
# Declare command line interpreter
14c3e74c   hitier   Move cli register...
17
18
# used with 'flask pdc_db' command
# see app/cli/__init__.py for more details.
508144eb   hitier   Add cli pattern
19
#
a17327bf   hitier   New db feeding co...
20
from app.commands import bp as cli_bp
14c3e74c   hitier   Move cli register...
21
pdc_app.register_blueprint(cli_bp)
425c1939   hitier   Move migrate init...
22
23
24
25
26
27
28
29


#
# Allow db migrations
#
# for help run
#  flask db
# or just
aea0ff9e   hitier   Tiny code reformat
30
#  flask db upgrade
425c1939   hitier   Move migrate init...
31
32
33
34
35
#
from app.models import db
from flask_migrate import Migrate
migrate = Migrate()
migrate.init_app(pdc_app, db)