Blockchain_KM/app/__init__.py
2024-12-02 01:18:08 +08:00

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