Django is a widely-used Python web application framework with a "batteries-included" philosophy. The principle behind batteries-included is that the common functionality for building web applications should come with the framework instead of as separate libraries.

For example, authentication, URL routing, a template engine, an object-relational mapper (ORM), and database schema migrations are all included with the Django framework. Compare that included functionality to the Flask framework which requires a separate library such as Flask-Login to perform user authentication.

The batteries-included and extensibility philosophies are simply two different ways to tackle framework building. Neither philosophy is inherently better than the other one.

Why is Django a good web framework choice?

The Django project's stability, performance and community have grown tremendously over the past decade since the framework's creation. Detailed tutorials and good practices are readily available on the web and in books. The framework continues to add significant new functionality such as database migrations with each release.

I highly recommend the Django framework as a starting place for new Python web developers because the official documentation and tutorials are some of the best anywhere in software development. Many cities also have Django-specific groups such as Django District, Django Boston and San Francisco Django so new developers can get help when they are stuck.

There's some debate on whether learning Python by using Django is a bad idea. However, that criticism is invalid if you take the time to learn the Python syntax and language semantics first before diving into web development.

Django books and tutorials

There are a slew of free or low cost resources out there for Django. Make sure to check the version numbers used in each post you read because Django was released over 10 years ago and has had a huge number of updates since then. These resources are geared towards beginners. If you are already experienced with Django you should take a look at the next section of resources for more advanced tutorials.

Django videos

Are you looking for Django videos in addition to articles? There is a special section for Django and web development on the best Python videos page.

Intermediate and advanced Django topics

These books and tutorials assume that you know the basics of building Django and want to go further to become much more knowledgeable about the framework.

Django migrations

Django Channels

Channels are a new mechanism in Django 1.9 provided as a standalone app. They may be incorporated into the core framework in 2.0+. Channels provide "real-time" full-duplex communication between the browser and the server based on WebSockets.

This tutorial shows how to get started with Django Channels in your project.

The channels examples repository contains a couple of good starter projects such as a live blog and a chat application to use as base code.

The Developing a Real-Time Taxi App with Django Channels and Angular course details how to create a ride-sharing app with Django Channels, Angular, and Docker. Along the way, you'll learn how to manage client/server communication with Django Channels, control flow and routing with Angular, and build a RESTful API with Django REST Framework.

Django testing

Django with JavaScript MVC frameworks

There are resources for JavaScript MVC frameworks such as Angular, React and Vue.js on their respective pages.

Django ORM tutorials

Django comes with its own custom object-relational mapper (ORM) typically referred to as "the Django ORM". Learn more about the Django ORM on the its own page and more broadly about ORMs on the Python object-relational mappers page.

Static and media files

Deploying and handling static and media files can be confusing for new Django developers. These resources along with the static content page are useful for figuring out how to handle these files properly.

Django project templates

Project templates, not to be confused with a template engine, generate boilerplate code for a base Django project plus optional libraries that are often used when developing web applications.

Caktus Group's Django project template is Django 2.2+ ready.

Cookiecutter Django is a project template from Daniel Greenfeld, for use with Audrey Roy's Cookiecutter. The template results are Heroku deployment-ready.

Two Scoops Django project template is also from the PyDanny and Audrey Roy. This one provides a quick scaffold described in the Two Scoops of Django book.

Sugardough is a Django project template from Mozilla that is compatible with cookiecutter.

Open source Django example projects

Reading open source code can be useful when you are trying to figure out how to build your own projects. This is a short list of some real-world example applications, and many more can be found on the Django example projects and code page.

Browser calls with Django and Twilio shows how to build a web app with Django and Twilio Client to turn a user's web browser into a full-fledged phone. Pretty awesome!

Openduty is a website status checking and alert system similar to PagerDuty.

Courtside is a pick up sports web application written and maintained by the author of PyCoder's Weekly.

These two Django Interactive Voice Response (IVR) system web application repositories part 1 and part 2 show you how to build a really cool Django application. There's also an accompanying blog post with detailed explanations of each step.

Taiga is a project management tool built with Django as the backend and AngularJS as the front end.

Chowist is a web application that replicates core features of Yelp and adds a couple more bells and whistles.

Open source code to learn Django

There are many open source projects that rely on Django. One of the best ways to learn how to use this framework is to read how other projects use it in real-world code. This section lists these code examples by class and method in Django's code base.

What do you need to learn next for your Django app?