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 subdirectory to check instead of running on the current working directory:

$ django_doctor fix --directory=foo

Check

You can see suggested changes in your shell without opening a browser too:

$ 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 and --directory the same as with the fix command.

Configuration

You can turn off checks. See here for more details.

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.3.0.zip (4.6 MB view details)

Uploaded Source

File details

Details for the file django_doctor-2.3.0.zip.

File metadata

  • Download URL: django_doctor-2.3.0.zip
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for django_doctor-2.3.0.zip
Algorithm Hash digest
SHA256 0ef2cfb6e38d8cb005c0ffd93bcc5406b8a3777409d379d6b07a2b23c52c1c0a
MD5 430cc7c08a2b5d6bd8a79db59980d206
BLAKE2b-256 32920050acabbe4d65332b39ffc2d6783fe29c3b0c4c89878e815ec9148bddf0

See more details on using hashes here.

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