mirror of
https://github.com/sstent/foodplanner.git
synced 2026-02-07 09:31:43 +00:00
added alembic database migrations, json import/export
This commit is contained in:
4
main.py
4
main.py
@@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
print("DEBUG: main.py started")
|
print("DEBUG: main.py started")
|
||||||
|
|
||||||
print("DEBUG: main.py started")
|
|
||||||
|
|
||||||
# Meal Planner FastAPI Application
|
# Meal Planner FastAPI Application
|
||||||
# Run with: uvicorn main:app --reload
|
# Run with: uvicorn main:app --reload
|
||||||
|
|
||||||
@@ -326,6 +324,7 @@ def scheduled_backup():
|
|||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
def startup_event():
|
def startup_event():
|
||||||
|
logging.info("FastAPI application startup event triggered.")
|
||||||
run_migrations()
|
run_migrations()
|
||||||
# Schedule the backup job
|
# Schedule the backup job
|
||||||
scheduler = BackgroundScheduler()
|
scheduler = BackgroundScheduler()
|
||||||
@@ -416,7 +415,6 @@ async def root(request: Request):
|
|||||||
# Admin Section
|
# Admin Section
|
||||||
@app.get("/admin", response_class=HTMLResponse)
|
@app.get("/admin", response_class=HTMLResponse)
|
||||||
async def admin_page(request: Request):
|
async def admin_page(request: Request):
|
||||||
print("DEBUG: /admin route accessed")
|
|
||||||
return templates.TemplateResponse("admin/index.html", {"request": request})
|
return templates.TemplateResponse("admin/index.html", {"request": request})
|
||||||
|
|
||||||
@app.get("/admin/imports", response_class=HTMLResponse)
|
@app.get("/admin/imports", response_class=HTMLResponse)
|
||||||
|
|||||||
Reference in New Issue
Block a user