Initial commit: Shop Database Flask Application
Flask backend with Vue 3 frontend for shop floor machine management. Includes database schema export for MySQL shopdb_flask database. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
25
shopdb/extensions.py
Normal file
25
shopdb/extensions.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Flask extensions initialization."""
|
||||
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
from flask_jwt_extended import JWTManager
|
||||
from flask_cors import CORS
|
||||
from flask_marshmallow import Marshmallow
|
||||
|
||||
# Initialize extensions without app
|
||||
db = SQLAlchemy()
|
||||
migrate = Migrate()
|
||||
jwt = JWTManager()
|
||||
cors = CORS()
|
||||
ma = Marshmallow()
|
||||
|
||||
|
||||
def init_extensions(app):
|
||||
"""Initialize all Flask extensions with app."""
|
||||
db.init_app(app)
|
||||
migrate.init_app(app, db)
|
||||
jwt.init_app(app)
|
||||
cors.init_app(app, resources={
|
||||
r"/api/*": {"origins": app.config.get('CORS_ORIGINS', '*')}
|
||||
})
|
||||
ma.init_app(app)
|
||||
Reference in New Issue
Block a user