Skip to content

Django Probe

It's hard to remove features in open-source software. Deprecation warnings exist, but people tend to ignore them. What maintainers want to know is how many people are using a feature. That's where Django Probe comes in.

Django Probe allows you to share which parts of Django your project uses. This package counts how often specific code patterns appear in your Django project and shares the aggregated information with the community.

By sharing what your project uses, you help support the Django community. No source code is shared, just the counts of which parts of Django are used, providing maintainers helpful information to direct the future of Django.

Quickstart

To quickly see what Django Probe would share:

$ uvx django-probe scan .
$ source .venv/bin/activate
$ pip install django-probe
$ django-probe scan .

To share the results, create a project token. If not using uv, you'll need to add Django Probe to the development dependencies first:

$ uvx django-probe login
$ uvx django-probe init
$ poetry add --group dev django-probe
$ poetry run django-probe login
$ poetry run django-probe init
$ pdm add -dG dev django-probe
$ pdm run django-probe login
$ pdm run django-probe init
$ source .venv/bin/activate
$ pip install django-probe
$ django-probe login
$ django-probe init

login stores an organization credential in your user configuration directory. init prints a separate project token; copy it, then inspect and submit the first scan:

$ export DJANGO_PROBE_TOKEN=<token_from_init>
$ uvx django-probe scan .      # inspect the payload; sends nothing
$ uvx django-probe submit .    # share the first scan
$ export DJANGO_PROBE_TOKEN=<token_from_init>
$ poetry run django-probe scan .      # inspect the payload; sends nothing
$ poetry run django-probe submit .    # share the first scan
$ export DJANGO_PROBE_TOKEN=<token_from_init>
$ pdm run django-probe scan .      # inspect the payload; sends nothing
$ pdm run django-probe submit .    # share the first scan
$ export DJANGO_PROBE_TOKEN=<token_from_init>
$ django-probe scan .      # inspect the payload; sends nothing
$ django-probe submit .    # share the first scan

Next, add Django Probe to CI so the project shares data on a schedule. See Privacy for exactly what a payload contains.

What we're looking to learn

In general, we're looking to see what parts of Django are used and which aren't. That is in general captured by the usages and settings data (if shared).

Additionally, we're looking for specific usages. These are in the probes portion of the payload. This list will grow over time, but for now there are two main usages:

  • The .extra() ORM API method has had a note about avoiding its usage for years. Let's determine if this is something that is central to a signficant number of Django projects.
  • The @cache_page decorator can easily cause problems for projects by storing and serving sensitive information such as CSRF tokens and CSP nonces. Understanding how widespread the usage is of it can help determine what further changes are needed.