20 lines
441 B
Python
20 lines
441 B
Python
from flask import Flask
|
|
|
|
from config import config
|
|
from app.blueprints import blueprints
|
|
from app.extensions import db, migrate
|
|
from app.celery import celery_init_app
|
|
|
|
def create_app(config_class=config):
|
|
app = Flask(__name__)
|
|
app.config.from_object(config_class)
|
|
|
|
db.init_app(app)
|
|
migrate.init_app(app)
|
|
|
|
for blueprint in blueprints:
|
|
app.register_blueprint(blueprint)
|
|
|
|
celery_init_app(app)
|
|
|
|
return app |