How can I tell pylint to accept my Django imports?
I know there is [django-lint][1], which does linting for Django apps. However, I am using some of the ORM classes inside another app, which is not a full Django app.
For that to work, I have the following three lines in my Python file:
import settings
from django.core.management import setup_environ
setup_environ(settings)
Running pylint over that file gives
jabber_listener.py:3: [F] Unable to import 'settings'
jabber_listener.py:5: [F] Unable to import 'django.core.management'
jabber_listener.py:39: [F] Unable to import 'django.utils.encoding'
jabber_listener.py:40: [F] Unable to import 'django.core.urlresolvers'
jabber_listener.py:41: [F] Unable to import 'django.contrib.sessions.models'
jabber_listener.py:42: [F] Unable to import 'django.contrib.auth.models'
jabber_listener.py:44: [F] Unable to import 'accounts.models'
As pylint does not execute the script, it obviously does not get the Python paths right. Any idea, how I can now tell pylint to set it up correctly?
[1]: http://nschum.de/src/emacs/company-mode/