meellc
HOBBYOP
10 months ago
Hey all! I'm deploying a FastAPI + Celery backend on Railway. The app tries to connect to the database using await database.connect() inside my lifespan function, but I'm getting this error:
NameError: name 'database' is not defined
I do have a DATABASE_URL set in my environment variables, and I'm using the databases library with asyncpg.
Any idea what I might be missing, or how I should properly structure this? Thanks!
2 Replies
clashing
FREE
10 months ago
How are you defining the database variable in your code, please provide that code snippet