21 lines
347 B
Python
21 lines
347 B
Python
from flask import Flask
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from config import Config
|
|
|
|
db = SQLAlchemy()
|
|
|
|
|
|
def create_app():
|
|
app = Flask(__name__)
|
|
app.config.from_object(Config)
|
|
|
|
db.init_app(app)
|
|
|
|
from app.routes import main
|
|
app.register_blueprint(main)
|
|
|
|
with app.app_context():
|
|
db.create_all()
|
|
|
|
return app
|