Skip to content
BENIBIX Learn

Django vs Flask

Django and Flask are both Python web frameworks. Django comes with most of what a site needs, from logins to an admin page. Flask gives you just the basics and you add the rest.

Development🌐 Web Development

Django

A Python web framework. It comes with most of the parts a site needs.

Django is a Python web framework that comes with most of what a site needs. It has an ORM for the database, a login system, forms, templates and a ready-made admin page. Its motto is batteries included, meaning you rarely need extra parts to start. It was first released in 2005 and runs many large sites. It also guards against common attacks by default.

Example
Emma builds a booking site in Django. In one afternoon she has a database, logins and an admin page for bookings.
Why it matters
Django gets a real, secure site running fast. It is a top choice for Python developers.
Full entry
Development🌐 Web Development

Flask

A small Python web framework. It gives you the basics, and you add the rest.

Flask is a small Python web framework that gives you just the basics. You get routing, request handling and templates, and you add the rest as you need it. It is often called a micro-framework because its core is so small. It was first released in 2010 and is popular for small apps, APIs and learning. Its simplicity makes it easy to see how a web app works.

Example
Jack builds a small API for his weather sensor with Flask. The whole app is one file of 30 lines.
Why it matters
Flask is a gentle start for Python web work. It stays out of your way.
Full entry

In one line

Django
A Python web framework. It comes with most of the parts a site needs.
Flask
A small Python web framework. It gives you the basics, and you add the rest.