OpenSTR/app/__init__.py

20 lines
No EOL
486 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 customer, technician, admin
app.register_blueprint(customer.customer_bp)
app.register_blueprint(technician.technician_bp)
app.register_blueprint(admin.admin_bp)
with app.app_context():
from app import models
return app