Skip to main content

Find and fix Django mishaps.

Project description

django-doctor

pypi-image semver-image

Django code quality assistant. Offline version of https://django.doctor

Find and fix around 40 breaches of Django best practice - helping you build world-class websites, release faster, and reduce dev costs.


Installation

$ pip install django-doctor

Fix

Run the fix suggestion wizard like so:

$ django_doctor fix

This runs a simple server on http://localhost:9000 and opens the wizard in your browser:

You then accept or reject the suggestions

And ultimately the selected changes are saved to your file system

You can change the address:

$ django_doctor fix --address=0.0.0.0 --port=9001

Your virtual environment directory is automatically skipped. To exclude other directories use the --ignore flag:

$ django_doctor fix --ignore=foo # single directory
$ django_doctor fix --ignore=foo --ignore=bar # multiple directories

You can also specify a directory to check instead of running on the current working directory. To run on only on "my_app" and "my_other_app":

$ django_doctor fix my_app my_other_app

Check

You can see suggested changes in your shell:

$ django_doctor check

Consider running this as a pre-commit hook, or on your CI to prevent new Django anti-patterns from being merged.

You can also use --ignore the same as with the fix command.

Configuration

You turn checks on/off with --disable and --enable. See here for the codenames of the checks.

Troubleshooting

Debugging

Try running django_doctor in verbose mode by adding --log-level=debug when executing the fix or check commands.

Pipenv

If you're using pipenv you may need to do pipenv install django-doctor --pre because:

  • django-doctor depends on black
  • black only releases pre-releases
  • pipenv ignores pre-releases

Support

Chat with us on https://django.doctor if you have any problems or have a feature request

GitHub integration

Django Doctor has GitHub integration. Learn more at https://django.doctor/github

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_doctor-2.6.0.zip (4.9 MB view hashes)

Uploaded Source

Built Distributions

django_doctor-2.6.0-cp39-cp39-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

django_doctor-2.6.0-cp39-cp39-win32.whl (4.3 MB view hashes)

Uploaded CPython 3.9 Windows x86

django_doctor-2.6.0-cp39-cp39-manylinux2010_x86_64.whl (9.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

django_doctor-2.6.0-cp39-cp39-manylinux2010_i686.whl (8.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

django_doctor-2.6.0-cp39-cp39-manylinux1_x86_64.whl (9.2 MB view hashes)

Uploaded CPython 3.9

django_doctor-2.6.0-cp39-cp39-manylinux1_i686.whl (8.9 MB view hashes)

Uploaded CPython 3.9

django_doctor-2.6.0-cp39-cp39-macosx_10_9_x86_64.whl (4.7 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

django_doctor-2.6.0-cp38-cp38-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

django_doctor-2.6.0-cp38-cp38-win32.whl (4.3 MB view hashes)

Uploaded CPython 3.8 Windows x86

django_doctor-2.6.0-cp38-cp38-manylinux2010_x86_64.whl (9.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

django_doctor-2.6.0-cp38-cp38-manylinux2010_i686.whl (9.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

django_doctor-2.6.0-cp38-cp38-manylinux1_x86_64.whl (9.9 MB view hashes)

Uploaded CPython 3.8

django_doctor-2.6.0-cp38-cp38-manylinux1_i686.whl (9.5 MB view hashes)

Uploaded CPython 3.8

django_doctor-2.6.0-cp38-cp38-macosx_10_9_x86_64.whl (4.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

django_doctor-2.6.0-cp37-cp37m-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

django_doctor-2.6.0-cp37-cp37m-win32.whl (4.3 MB view hashes)

Uploaded CPython 3.7m Windows x86

django_doctor-2.6.0-cp37-cp37m-manylinux2010_x86_64.whl (8.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

django_doctor-2.6.0-cp37-cp37m-manylinux2010_i686.whl (8.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

django_doctor-2.6.0-cp37-cp37m-manylinux1_x86_64.whl (8.6 MB view hashes)

Uploaded CPython 3.7m

django_doctor-2.6.0-cp37-cp37m-manylinux1_i686.whl (8.3 MB view hashes)

Uploaded CPython 3.7m

django_doctor-2.6.0-cp37-cp37m-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

django_doctor-2.6.0-cp36-cp36m-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

django_doctor-2.6.0-cp36-cp36m-win32.whl (4.2 MB view hashes)

Uploaded CPython 3.6m Windows x86

django_doctor-2.6.0-cp36-cp36m-manylinux2010_x86_64.whl (8.3 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

django_doctor-2.6.0-cp36-cp36m-manylinux2010_i686.whl (8.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

django_doctor-2.6.0-cp36-cp36m-manylinux1_x86_64.whl (8.3 MB view hashes)

Uploaded CPython 3.6m

django_doctor-2.6.0-cp36-cp36m-manylinux1_i686.whl (8.1 MB view hashes)

Uploaded CPython 3.6m

django_doctor-2.6.0-cp36-cp36m-macosx_10_9_x86_64.whl (4.6 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page