48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
|
|
from flask import Flask
|
||
|
|
from flask_sqlalchemy import SQLAlchemy
|
||
|
|
from app.config import Config
|
||
|
|
|
||
|
|
db = SQLAlchemy()
|
||
|
|
|
||
|
|
def create_app():
|
||
|
|
app = Flask(__name__)
|
||
|
|
app.config.from_object(Config)
|
||
|
|
|
||
|
|
db.init_app(app)
|
||
|
|
|
||
|
|
# Register Blueprints
|
||
|
|
from app.routes.dashboard import dashboard_bp
|
||
|
|
from app.routes.file_import import file_import_bp
|
||
|
|
# from app.routes.user import user_bp
|
||
|
|
|
||
|
|
app.register_blueprint(dashboard_bp)
|
||
|
|
app.register_blueprint(file_import_bp)
|
||
|
|
# app.register_blueprint(user_bp)
|
||
|
|
|
||
|
|
from app.routes.subcontractor_routes import subcontractor_bp
|
||
|
|
app.register_blueprint(subcontractor_bp)
|
||
|
|
|
||
|
|
return app
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
# from flask import Flask
|
||
|
|
# from app.config import Config
|
||
|
|
|
||
|
|
# def create_app():
|
||
|
|
# app = Flask(__name__)
|
||
|
|
# app.config.from_object(Config)
|
||
|
|
|
||
|
|
# # Register Blueprints
|
||
|
|
# from app.routes.dashboard import dashboard_bp
|
||
|
|
# from app.routes.file_import import file_import_bp
|
||
|
|
# from app.routes.user import user_bp
|
||
|
|
|
||
|
|
# app.register_blueprint(dashboard_bp)
|
||
|
|
# app.register_blueprint(file_import_bp)
|
||
|
|
# app.register_blueprint(user_bp)
|
||
|
|
|
||
|
|
# return app
|