For the first time in Python's history, neither Django nor Flask is the most-used web framework — FastAPI is. The 2025 State of Python survey, run jointly by the Python Software Foundation and JetBrains among more than 30,000 developers, found FastAPI adoption at 38%, ahead of Django at 35% and Flask at 34%, up from just 29% a year earlier. The shift tracks closely with AI: FastAPI's async-first architecture fits naturally with machine learning model serving, RAG (retrieval-augmented generation) systems, and AI agent APIs, where request handling times vary and non-blocking I/O matters.
Why Frameworks Matter at All
Modern web applications need secure authentication, database management, API communication, input validation, and protection against common attack patterns before they can be considered production-ready. Building all of this from scratch is slow and introduces real security risk — frameworks solve this by providing tested, widely-used, continuously patched solutions for problems every serious web application shares. Using an established framework instead of custom-built infrastructure meaningfully reduces the odds of shipping a preventable vulnerability like SQL injection, cross-site scripting, or CSRF, since these protections come built-in and are maintained by large communities rather than reinvented per-project.
Django: Still the Full-Stack Default
Django remains the strongest choice for full-stack applications that need a built-in admin interface, authentication system, and object-relational mapper out of the box — its "batteries-included" philosophy hasn't gone away. Despite FastAPI's overall adoption lead, Django's decline in the JetBrains survey was modest (35%, down slightly from the prior year), reflecting how much established Django infrastructure remains in production even as new projects increasingly start elsewhere. Django has also added meaningful async support in recent versions, narrowing what used to be a clear gap with FastAPI, though its ORM and other async internals are still described by the Django team as a work in progress as of version 5.2.
FastAPI: Now the Default for New APIs, Especially AI-Facing Ones
FastAPI's rise tracks closely with the broader AI buildout: teams building RAG pipelines, LLM orchestration layers, or AI agent APIs are increasingly choosing it by default. Its core advantages — automatic OpenAPI documentation, Pydantic-based type validation, and native async support — reduce a category of bugs and boilerplate that older frameworks require more manual handling for. For any team building an AI agent that needs to expose tool-calling endpoints or serve model inference, FastAPI has become close to the default starting point.
Flask: Still Viable, Increasingly a Legacy Choice for New Work
Flask hasn't disappeared, but its growth has plateaued while FastAPI's has accelerated — organizations with pre-2020 Python infrastructure are more likely to be predominantly Flask-based, while newer projects skew toward FastAPI. Flask remains a reasonable choice for small applications, simple APIs, or situations where its minimal, unopinionated structure is genuinely preferred over FastAPI's more structured approach — but for a brand-new project in 2026, it's a harder default to justify than it was five years ago.
How to Actually Choose
If you're building a full-stack application with an admin panel, user-facing templates, and complex data relationships, Django remains the strongest fit. If you're building a new API — especially one serving AI/ML models, RAG pipelines, or agent tool-calling — FastAPI is the current default for good reason. If you're maintaining or extending an existing Flask codebase, or building something genuinely minimal, Flask is still a defensible choice, just a less common one for new projects.
The right call depends on what you're building, not which framework was most popular five years ago — but it's worth knowing that the ground has genuinely shifted under this decision since the last time many teams made it.

Comments