Files
digital-garage-sale/app.py
2025-04-29 13:54:11 -07:00

23 lines
602 B
Python

import os
from datetime import datetime
from flask import Flask
from app import create_app, db
from app.models import Category, Item, ContactInfo
app = create_app()
@app.shell_context_processor
def make_shell_context():
return {'db': db, 'Category': Category, 'Item': Item, 'ContactInfo': ContactInfo}
@app.context_processor
def inject_now():
return {'now': datetime.utcnow()}
# Create upload folder when app starts instead of using before_first_request
with app.app_context():
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
if __name__ == '__main__':
app.run(debug=True)