All Posts
Why I Switched from Django to Flask (and Back)
I started with Django. Then I moved to Flask because it felt lighter and more flexible. Then I went back to Django. Here's why.
## The Flask Phase
When I first learned Flask, it felt liberating. No ORM opinions, no admin panel forcing its structure on me, no magic. Just Python and Jinja templates.
I built three production apps with Flask. They all worked. But as they grew, I kept reimplementing things Django already provides:
- Authentication system
- Admin interface
- Database migrations
- ORM relationships and query optimization
- Form validation
- CSRF protection
## The Return to Django
The breaking point was when I needed to add user roles and permissions to a Flask app. I spent two days building what Django Guardian gives you in an afternoon.
Django's opinionated structure isn't a limitation — it's a head start. The admin panel alone saves weeks of development time.
## What I Learned
Framework choice matters less than people think. What matters is:
1. Understanding the fundamentals (HTTP, SQL, authentication)
2. Picking a framework your team knows
3. Not fighting the framework's conventions
I still use Flask for tiny microservices and prototypes. But for anything that will be maintained long-term, Django is where I start.