Syntastic + Django

django, syntastic, syntax-checking

Solution

piggybacking on @supervacuo's answer:

there is a way to get this working for syntastic and it's rather straightforward, if not easy to figure out for someone unfamiliar with syntastic options (like, say, me):

in your .vimrc, add this line:

`let g:syntastic_python_pylint_args = "--load-plugins pylint_django"`

of course, this does require `pylint-django` be installed in your environment

Problem

I just started developing on Django, and then I thought using the Syntastic syntax checker on it would be a good idea. The problem is that it complains about some things being wrong when, in fact, they aren't. Examples: For ``` from django.core.urlresolvers import reverse ``` I get: ``` error| [F0401] Unable to import 'django.core.urlresolvers' ``` For ``` amount = self.sale_set.filter(date__year=year).aggregate(sum=Sum('amount'))["sum"] ``` I get (where `self` is an `Album`) ``` error| [E1101, Album.get_sales_total] Instance of 'Album' has no 'sale_set' member ``` This code runs perfectly even with these "errors", but how can I make Syntastic behave correctly?

Original source