Skip to content

Commit f7b556b

Browse files
committed
Adding information to the README about hwo to configure Django settings and the reason for doing so
1 parent 08ad9de commit f7b556b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,21 @@ about missing Django!
4444
Usage
4545
-----
4646

47-
Ensure ``pylint-django`` is installed and on your path and then execute::
47+
48+
Ensure ``pylint-django`` is installed and on your path. In order to access some
49+
of the internal Django features to improve pylint inspections, you should also
50+
provide a Django settings module appropriate to your project. This can be done
51+
either with an environment variable::
4852

4953
DJANGO_SETTINGS_MODULE=your.app.settings pylint --load-plugins pylint_django [..other options..] <path_to_your_sources>
5054

55+
Alternatively, this can be passed in as a commandline flag::
56+
57+
pylint --load-plugins pylint_django --django-settings-module=your.app.settings [..other options..] <path_to_your_sources>
58+
59+
If you do not configure Django, default settings will be used but this will not include, for
60+
example, which applications to include in `INSTALLED_APPS` and so the linting and type inference
61+
will be less accurate. It is recommended to specify a settings module.
5162

5263
Prospector
5364
----------

0 commit comments

Comments
 (0)