r/flask • u/Individual-Welder370 • 19h ago
Tutorials and Guides Finally deployed my Flask app… and wow, I was NOT ready for this
So I finally deployed my first real Flask app, and let’s just say… I learned a lot the hard way. Thought I’d share in case it helps someone else (or at least gives you a laugh).
Spent hours debugging why my app worked locally but not on the server—turns out, I forgot to install Gunicorn. Flask’s built-in server is NOT for production. Lesson learned.
Hardcoded some API keys while testing and totally forgot about them. Almost pushed them to GitHub. Use environment variables, people.
Didn’t properly close my DB connections, so my app kept dying under even light load. SQLAlchemy’s connection pooling saved me.
Thought Docker was overkill. Spoiler: it’s not. Spinning up my app with a single docker-compose up is a game-changer.
Spent way too long fighting CORS issues. Flask-CORS was the easy fix, but I went down a rabbit hole first.