2024-01-31 19:37:01 +10:00
|
|
|
from flask import Flask
|
|
|
|
|
2024-01-31 20:51:31 +10:00
|
|
|
from config import config
|
2024-01-31 19:37:01 +10:00
|
|
|
from app.blueprints import blueprints
|
|
|
|
from app.extensions import db, migrate
|
|
|
|
from app.celery import celery_init_app
|
|
|
|
|
2024-01-31 20:51:31 +10:00
|
|
|
def create_app(config_class=config):
|
2024-01-31 19:37:01 +10:00
|
|
|
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
|