Essential Django 3rd Party Packages
Tags: django, python, tutorial, beginners
Published: 2020-02-07 18:39:33

Django relies heavily on its ecosystem of third-party packages which add additional functionality to the framework. But since there are over 3,000 available--which you can search on the lovely [Django Packages](https://djangopackages.org) website--navigating all of them can be overwhelming.

I recently wrote a post on the [Top 10 Most Popular Django packages](https://learndjango.com/tutorials/10-most-used-django-packages) and there's a lively discussion on the official Django forum around [Top 5 3rd party packages](https://forum.djangoproject.com/t/top-5-3rd-party-packages/391) as well. But here is my current list of must-have Django packages that I reach to for almost every new project.

## Django Utilities
[django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar)
Local debugging of queries, viewing requests and responses, and more.

[django-extensions](https://github.com/django-extensions/django-extensions)
Custom extensions including `shell_plus` to automatically load models into the shell and `runserver_plus` among many others.

[django-environ](https://github.com/joke2k/django-environ)
Important information should be stored in environment variables, not in source code. This includes your `SECRET_KEY`, any API keys, database credentials, payment info, and so on.

[django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms)
The best way to have DRY (Don't Repeat Yourself) forms.

[django-filter](https://github.com/carltongibson/django-filter)
An improved way to filter Django QuerySets based on user selections.

[django-allauth](https://github.com/pennersr/django-allauth)
A host of improvements to Django's minimal user registration defaults. Includes support for social authentication, email-only login, and many more features.

[django-redis](https://github.com/niwinz/django-redis)
Redis support for Django.

[django-q](https://github.com/koed00/django-q)
A task queue that supports Redis, Disque, and several others.

[django-compressor](https://github.com/django-compressor/django-compressor)
Compresses JavaScript and CSS into a single cached file.

[django-silk](https://github.com/jazzband/django-silk)
Live profiling and inspection of HTTP requests and database queries.

## APIs
[djangorestframework](https://github.com/encode/django-rest-framework)
With a small amount of code, any existing Django project can be transformed into a REST API. A truly amazing package and used in most larger Django projects that rely on a dedicated JavaScript front-end.

[django-cors-headers](https://github.com/adamchainz/django-cors-headers)
If your backend and frontend are hosted on different sites, which is often the case, you need to manage your CORS Headers. This elegant package handles that for you.

[djangorestframework_simplejwt](https://github.com/davesque/django-rest-framework-simplejwt)
If you want to use JWTs in your API, this is the current go-to package.

## Images
[django-storages](https://github.com/jschneier/django-storages)
Are you handling user-uploaded content, commonly referred to as `media` in the Django world? Or maybe using a dedicated CDN like S3? `django-storages` has you covered with support for multiple storage providers.

[sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail)
Thumbnails and image resizing.

## Testing
[pytest-django](https://github.com/pytest-dev/pytest-django)
Testing is important and on most projects you'll reach for pytest to improve your testing suite. This plugin provides easy integration.

[django_coverage_plugin](https://github.com/nedbat/django_coverage_plugin)
A plugin for adding `coverage.py` to measure Django template execution.

[model-bakery](https://github.com/model-bakers/model_bakery)
A smart way to create fixtures for testing. Previously named [Model Mommy](https://github.com/berinhard/model_mommy/stargazers).


## Python packages
[black](https://github.com/psf/black)
An uncompromising Python code formatter. 

[coverage](https://github.com/nedbat/coveragepy)
Code coverage measurement.

[factory-boy](https://github.com/FactoryBoy/factory_boy)
Improved fixture testing for Python.

[pytest](https://github.com/pytest-dev/pytest)
A framework for writing small, modular tests.

[Pillow](https://github.com/python-pillow/Pillow)
The Python Imaging Library.

[gunicorn](https://gunicorn.org) 
A production Python WSGI server.

[pyscopg2-binary](https://github.com/psycopg/psycopg2)
A PostgreSQL database adapter for Python.

[whitenoise](https://github.com/evansd/whitenoise)
The default way to host static files in production for Python.

If you'd like to see even more curated packages, take a look at the [awesome-django repo](https://github.com/wsvincent/awesome-django).