Discover 54 Hidden Gems: Lesser Known Packages for Django. PART I

Django Viewflow
4 min readFeb 1, 2023

--

Github star count is not a reliable indicator of a package’s usage. Last time we investigated the Top 100 most downloaded Django packages in 2022. We found that it does not change from year to year, with the exception of a rapidly increasing number of downloads.

If you require popular and actively maintained dependencies for your project, they can be located here.

This time let’s explore the less obvious but still popular in the community next hundred Django packages. We will skip the obsolete and unsupported ones and leave only gems with active development and Django≥4.0 support

Graph QL

GraphQL has experienced the largest growth in popularity over the past year. Meanwhile, the authentication add-on package has seen a clear increase in demand

django-graphql-jwt (1.2mln downloads/year)

JSON Web Token authentication for Django GraphQL https://pypi.org/project/django-graphql-jwt /

Settings Management

In the top 100 packages, we saw very basic packages for meeting the 12-factor application requirements for Django. Next in line are two packages used to manage Django’s complex settings

django-configurations (1mln downloads/year)

Django project configuration by relying on the composability of Python classes https://github.com/jazzband/django-configurations

django-split-settings (800k downloads/year)

Organize Django settings into multiple files and directories https://github.com/wemake-services/django-split-settings

Monitoring

As projects grow in complexity and importance, the need for meticulous logging and monitoring of the code in production becomes increasingly crucial.

django-structlog (1.1mln downloads/year)

A structured logging integration for Django project using structlog https://github.com/jrobichaud/django-structlog

opentelemetry-instrumentation-django (800k downloads/year)

This library allows tracing requests for Django applications https://github.com/open-telemetry/opentelemetry-python-contrib

django-watchman (680k downloads/year)

Exposes a status endpoint for your backing services like databases, caches, etc https://github.com/mwarkentin/django-watchman

ORM Enhancement

The most in-demand category for both package developers and users is packages for improving ORM. We have many such packages in the top 100, and there are even more

django-cleanup (1.3mln downloads/year)

The app automatically deletes files for FileField, ImageField and subclasses https://github.com/un1t/django-cleanup

django-safedelete (1.2mln downloads/year)

Allows you to transparently delete your objects, without having them deleted from your database https://github.com/makinacorpus/django-safedelete

django-autoslug (1.1mln downloads/year)

An improved slug field which can automatically: populate itself from another field, preserve uniqueness, use custom slugify() functions for better i18n https://github.com/justinmayer/django-autoslug/

django-solo (1.1mln downloads/year)

Helps working with database tables that only have one row https://github.com/lazybird/django-solo/

django-ordered-model (1mln downloads/year)

Allows models to be ordered and provides a simple admin interface for reordering them https://github.com/django-ordered-model/django-ordered-model

django-deprecate-fields (980k downloads/year)

Mark afield as deprecated and prevents it usage, till it was deleted after migration https://github.com/3YOURMIND/django-deprecate-fields

django-cryptography (940k downloads/year)

A set of primitives for easily encrypting data in Django https://github.com/georgemarshall/django-cryptography

django-postgres-extra (850k downloads/year)

Make all of PostgreSQL’s awesome features available through the Django ORM https://github.com/SectorLabs/django-postgres-extra

django-sortedm2m (830k downloads/year)

A drop-in replacement for django’s own ManyToManyFieldbut remembers the order of added relations https://github.com/jazzband/django-sortedm2m

django-auditlog (660k downloads/year)

Simple Django app that logs changes to models along with the user who made the changes https://github.com/jazzband/django-auditlog

django-lifecycle (640 downloads/year)

A decorator to use instead of signals to add lifecycle hooks to your Django models https://github.com/rsinger86/django-lifecycle

django-add-default-value (600k downloads/year)

Migration Operation that can be used to transfer a field’s default value to the database scheme https://github.com/3YOURMIND/django-add-default-value

Development Utilities

Indispensable tools that will simplify the workflow during the development phase

flake8-django (1.3mln downloads/year)

A flake8 plugin to detect bad practices on Django projects https://github.com/rocioar/flake8-django

django-hijack (1.2mln downloads/year)

Allow to log in and work on behalf of other users without having to know their credentials https://github.com/django-hijack/django-hijack

django-impersonate (940k downloads/year)

The same as django-hijack. The application to allow superusers to “impersonate” other non-superuser accounts. https://code.netlandish.com/~petersanchez/django-impersonate/

django-request-logging (740k downloads/year)

Intuitive and color coded request/response payload logging, for web and API requests https://github.com/Rhumbix/django-request-logging

Test Utilities

Django’s test support is impressive, but those packages pushes it even more

django-webtest (800k downloads/year)

App for instant integration of WebTest with Django’s testing framework https://github.com/django-webtest/django-webtest

django-test-plus (740k downloads/year)

Useful additions to Django’s default TestCase https://github.com/revsys/django-test-plus/

django-test-migrations (740k downloads/year)

An extension allows to test django schema and data migrations https://github.com/wemake-services/django-test-migrations

django-mock-queries (700k downloads/year)

A library for mocking Django queryset functions in memory for testing https://github.com/stphivos/django-mock-queries

Let’s proceed to the next section, in which we will study packages that improve REST interface support, Django administration and others.

Continue in PART II

--

--