This commit includes the initial files for the EP inspection tool prototype, including the inspection-app directory with the application code, the prompt.txt file with the inspection prompt, and SHARED_TASK_NOTES.md for documentation. These files establish the foundation for the inspection tool implementation.
39 lines
No EOL
1 KiB
Python
39 lines
No EOL
1 KiB
Python
from flask import Flask
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_login import LoginManager
|
|
from config import Config
|
|
import os
|
|
|
|
# Initialize extensions
|
|
db = SQLAlchemy()
|
|
login_manager = LoginManager()
|
|
|
|
def create_app(config_class=Config):
|
|
app = Flask(__name__)
|
|
app.config.from_object(config_class)
|
|
|
|
# Ensure upload directory exists
|
|
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
|
|
|
# Initialize extensions with app
|
|
db.init_app(app)
|
|
login_manager.init_app(app)
|
|
login_manager.login_view = 'auth.login'
|
|
login_manager.login_message = 'Please log in to access this page.'
|
|
|
|
# Register blueprints
|
|
from app.routes.auth import auth_bp
|
|
from app.routes.inspections import inspections_bp
|
|
from app.routes.admin import admin_bp
|
|
from app.routes.export import export_bp
|
|
|
|
app.register_blueprint(auth_bp)
|
|
app.register_blueprint(inspections_bp)
|
|
app.register_blueprint(admin_bp)
|
|
app.register_blueprint(export_bp)
|
|
|
|
# Create tables
|
|
with app.app_context():
|
|
db.create_all()
|
|
|
|
return app |