Flask-web_platform/app/__init__.py
2024-10-09 17:35:57 +08:00

21 lines
445 B
Python

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from config import Config
db = SQLAlchemy()
login_manager = LoginManager()
login_manager.login_view = 'main.login'
def create_app():
app = Flask(__name__)
app.config.from_object(Config)
db.init_app(app)
login_manager.init_app(app)
from app.routes import bp as main_bp
app.register_blueprint(main_bp)
return app