How can I tell pylint to accept my Django imports?
I know there is [django-lint], 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:
from django.core.management import setup_environ
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?