My Authors
Read all threads
Python 🐍 for web development?

Let’s take a minute and look into Django, Flask, and FastAPI.

I want to make sure you know exactly which one to use for your next project.

🧵👇
▫️Django

It’s a high-level web framework focused on the rapid creation of database-driven websites. You get access to a lot of components to build a complete application really easily.

Django it’s all about reusability and rapid development.

👇
▫️Flask

It’s a microframework. This means that it’s light and comes with the minimum necessary to create a basic web application.

Flask aims to keep the core simple but extensible. It won’t make many decisions for you, and it’s very flexible about the pieces you use.

👇
▫️FastAPI

It’s a very high-performance web framework focused on building APIs. Just like Flask, FastAPI is extensible and very flexible about the different components you use.

One of the key aspects of FastAPI is that it allows the use of Python’s async functionality.

👇
On your next project, you can use any of these three web frameworks and make it work, but you can also pick the best one suited for your needs.

Let’s look at some criteria for selecting which one should be your top choice.

👇
Django advantages:

▫️Rapid development
▫️A lot of out-of-the-box functionality
▫️Easy for building complex, full web applications
▫️MVC design paradigm
▫️Robust security features
▫️Extensible (a lot of components out there)
▫️Large community

👇
Flask advantages:

▫️Very light
▫️Doesn’t make decisions for you
▫️Doesn’t bring anything that you don’t need
▫️Modular, so it’s easy to extend
▫️You can plug in your favorite ORM
▫️Great documentation
▫️Very easy to start with
▫️Large community

👇
FastAPI advantages:

▫️Native async support
▫️Faster than Django and Flask
▫️Very light
▫️Focuses on building APIs
▫️Out-of-the-box support for GraphQL
▫️Out-of-the-box support for OpenAPI
▫️Great documentation
▫️Large community

👇
If you are building an e-commerce platform, Django will offer a lot of functionality out of the box.

If you are building an API, look into FastAPI.

If you want the flexibility of a modular web framework that you can easily extend with different pieces, look into Flask.

👇
Personally, and because of the nature of my work, I’ve used Flask more than anything, but lately, I’ve been moving more and more towards FastAPI.

For the work I do, the performance improvement does make a difference!

How about you?
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Santiago ☉

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!