Essential Django 3rd Party Packages

Will Vincent - Feb 7 '20 - - Dev Community

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 website--navigating all of them can be overwhelming.

I recently wrote a post on the Top 10 Most Popular Django packages and there's a lively discussion on the official Django forum around Top 5 3rd party packages 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
Local debugging of queries, viewing requests and responses, and more.

django-extensions
Custom extensions including shell_plus to automatically load models into the shell and runserver_plus among many others.

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
The best way to have DRY (Don't Repeat Yourself) forms.

django-filter
An improved way to filter Django QuerySets based on user selections.

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
Redis support for Django.

django-q
A task queue that supports Redis, Disque, and several others.

django-compressor
Compresses JavaScript and CSS into a single cached file.

django-silk
Live profiling and inspection of HTTP requests and database queries.

APIs

djangorestframework
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
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
If you want to use JWTs in your API, this is the current go-to package.

Images

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
Thumbnails and image resizing.

Testing

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
A plugin for adding coverage.py to measure Django template execution.

model-bakery
A smart way to create fixtures for testing. Previously named Model Mommy.

Python packages

black
An uncompromising Python code formatter.

coverage
Code coverage measurement.

factory-boy
Improved fixture testing for Python.

pytest
A framework for writing small, modular tests.

Pillow
The Python Imaging Library.

gunicorn
A production Python WSGI server.

pyscopg2-binary
A PostgreSQL database adapter for Python.

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.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .