Introduction to Django – a Python framework for web applications


Lesson 8 of 14 · Python for the web

So far we have learned how to build web applications with the Flask framework.

Now we will meet Django – one of the best known and most powerful Python frameworks for web development.

Django is a complete framework that already contains many of the features web applications need.

What is Django?

Django is an open-source Python framework that makes it possible to develop modern web applications quickly.

It was created to make it easier for programmers to build complex projects.

  • web applications
  • administration systems
  • API services
  • large web portals

Why use Django?

Django offers many features that in other frameworks we have to implement ourselves.

  • working with a database
  • user authentication
  • an administration panel
  • a template system
  • security mechanisms
Because of its many built-in features, Django is ideal for larger projects.

Well-known sites that use Django

Django is used by many well-known companies:

  • Instagram
  • Pinterest
  • Mozilla
  • Disqus

The difference between Flask and Django

Flask and Django are both Python web frameworks, but they follow different philosophies.

  • Flask – simple and flexible
  • Django – complete and structured
Flask gives the programmer more freedom, while Django offers ready-made solutions.

How Django works

Django uses an architecture called the MVT model.

  • Model – working with the database
  • View – the application logic
  • Template – displaying HTML pages

Installing the Django framework

Django is installed with the Python package manager pip.


pip install django

If you have several Python versions installed, you can use the command:


pip3 install django

Checking the installation

We can check whether Django is installed with the following command:


django-admin --version
Example result
4.2.0

What we will learn in the next lessons

In the following lessons we will build a real Django web application.

  • how to create a Django project
  • how to make an application
  • how to use a database
  • how to build a user system
At the end of the Django section we will build a small web project using all the concepts we have learned.

Related lessons


Frequently asked questions

What is Django?

Django is a Python framework for developing web applications.

Is Django hard to learn?

Django has more features than Flask, but it is well documented and widely used.

Is Django good for large projects?

Yes. Django is designed for scalable web applications.

Does Django use a database?

Yes. Django has a built-in system for working with databases.