The 10 Most-Used Django Packages
Tags: django, python
Published: 2020-02-05 00:12:09

Inspired by a recent article on [The 22 Most-Used Python Packages in the World](https://medium.com/better-programming/the-22-most-used-python-packages-in-the-world-7020a904b2e),  I teamed up with [Jeff Triplett](https://jefftriplett.com/about/) to investigate the top 10 Django packages based on [PyPI](https://pypi.org/) (The Python Package Index) downloads. We looked at the [past 30 days](https://hugovk.github.io/top-pypi-packages/) though data from the past 365 days is also available.

While it's possible to manually look for Django-related packages, we're using Python so creating a brief script is the preferred method. See Jeff's [gist here](https://gist.github.com/jefftriplett/56ad443c21fee742d062d0a840aeeecd) if you'd like to recreate or tweak the results for yourself.

Before we dive in, a brief caveat: downloads are not a perfect measure of usage. They are easy to game if one is so inclined. The "real" test would be to filter based on actual live in-production usage. But... that data does not exist. So we'll use PyPI downloads as a rough proxy.

---

## 1. [Django](https://pypi.org/project/Django/)
_3,831,882 downloads_

No surprises here! Django clocks in with almost 4 millions downloads over the past 30 days. What's interesting is that Flask has over 10 million downloads over the same period. I would love to know what percentage of that is one-off Flask API endpoints or Python beginners playing around versus actual in-production usage on a site. I love Flask, as well as Django, but I highly suspect Django has deeper real-world penetration. Alas, the PyPI stats don't agree.

---

## 2. [Django REST Framework](https://pypi.org/project/djangorestframework/)
_1,792,469 downloads_

If ever a third-party package was core to modern Django usage, this is it. [Django REST Framework](https://www.django-rest-framework.org) is the default way to quickly add API functionality to an existing Django project. Creator Tom Christie has done a masterful job over the years of continually improving the codebase, managing a community of contributors, and finding a sustainable funding route via [Encode](https://www.encode.io).

---

## 3. [django-cors-headers](https://pypi.org/project/django-cors-headers/) 
_944,291 downloads_

API endpoints aren't very useful without Cross-Origin Resource Sharing (CORS) server headers properly configured. This project from [Adam Johnson](https://adamj.eu) greatly simplifies the process.

---

## 4. [django-filter](https://pypi.org/project/django-filter/) 
_877,311 downloads_

A powerful and reusuable Django app for filtering QuerySets based on user selections. It also has robust support for adding filters to Django REST Framework.

---

## 5. [django-redis](https://pypi.org/project/django-redis/) 
_815,821 downloads_

This package provides a full-featured redis cache backend, which has overtaken Memcached as the most popular caching tool for many developers. 

---

## 6. [django-extensions](https://pypi.org/project/django-extensions/)
_814,693 downloads_

The true Swiss Army watch of useful additions to Django. There is a [long list of features](https://django-extensions.readthedocs.io/en/latest/) of which particular favorites are `shell_plus` for autoloading database models and `runserver_plus` for an improved local server powered by Werkzeug.

---

## 7. [pytest-django](https://pypi.org/project/pytest-django/) 
_698,664 downloads_

A plug-in for adding [pytest](https://docs.pytest.org/en/latest/) to a Django application. I'm a little surprised but pleased to see it rank so high. For many Python and Django developers, pytest is a must.

---

## 8. [django-storages](https://pypi.org/project/django-storages/) 
_695,562 downloads_

An elegant way to work with custom storage backends like S3 and [many more](https://django-storages.readthedocs.io/en/latest/). If you're accepting user-uploaded files or working at serious scale, this package is a must. 

---

## 9. [django-debug-toolbar](https://pypi.org/project/django-debug-toolbar/) 
_643,937 downloads_

Another mainstay of modern Django development, I'm surprised this doesn't rank higher to be honest. If you want to properly debug your Django app, this is the go-to choice. It also allows for performance improvements via inspection of local queries among many other features.

---

## 10. [django-appconf](https://pypi.org/project/django-appconf/)
_411,202 downloads_

An app to handle configuration defaults of packaged Django apps gracefully. It ranks higher than I would have guessed but it does provide a nice, concise way to not repeat your configs for multiple apps.

---

If you're looking for more Django packages, I curate a list over in the [awesome-django repo](https://github.com/wsvincent/awesome-django). There is a lively discussion of the [top 5 3rd party packages](https://forum.djangoproject.com/t/top-5-3rd-party-packages/391/21) over on the official Django Forum. Or if you prefer to see all Django packages, take a look at the [Django Packages website](https://djangopackages.org).

The interesting thing, if you look at this list, is that versions of these packages also rank highly in the Rails, Laravel, and other web framework communities. Which makes sense: the web isn't _that_ different when you get down to it and with experience, the common patterns and challenges are more readily apparent than they are to an overwhelmed beginner.

Let me know if I've missed any packages on here!