Initial commit: InviteMe event registration app
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from flask import Flask
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from config import Config
|
||||
import os
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
def create_app(config_class=Config):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
# Ensure upload directories exist
|
||||
os.makedirs(app.config["PHOTO_FOLDER"], exist_ok=True)
|
||||
os.makedirs(app.config["QR_FOLDER"], exist_ok=True)
|
||||
os.makedirs(os.path.dirname(app.config["SQLALCHEMY_DATABASE_URI"].replace("sqlite:///", "")), exist_ok=True)
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
from app.routes import main_bp
|
||||
app.register_blueprint(main_bp)
|
||||
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user