pylint-django
is a Pylint plugin for improving code analysis for when analysing code using Django. It is also used by the Prospector tool.
Ensure pylint-django
is installed and on your path (pip install pylint-django
), and then run pylint:
pylint --load-plugins pylint_django [..other options..]
If you have prospector
installed, then pylint-django
will already be installed as a dependency, and will be activated automatically if Django is detected.
prospector [..other options..]
- Prevents warnings about Django-generated attributes such as
Model.objects
orViews.request
. - Prevents warnings when using
ForeignKey
attributes ("Instance of ForeignKey has no member"). - Fixes pylint's knowledge of the types of Model and Form field attributes
- Validates
Model.__unicode__
methods. Meta
informational classes on forms and models do not generate errors.
pylint-django
is available under the GPLv2 license.