forked from M-Labs/web2019
23 lines
378 B
Python
23 lines
378 B
Python
|
from flask import Flask
|
||
|
from flask_mail import Mail
|
||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||
|
|
||
|
import config
|
||
|
|
||
|
|
||
|
mail = Mail()
|
||
|
|
||
|
|
||
|
def create_app(cfg=config):
|
||
|
app = Flask(__name__)
|
||
|
app.config.from_object(cfg)
|
||
|
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||
|
|
||
|
mail.init_app(app)
|
||
|
|
||
|
from app.api import bp as bp_api
|
||
|
|
||
|
app.register_blueprint(bp_api)
|
||
|
|
||
|
return app
|