7

I'm using ALE with Pylint and pylint-django, but I'm not able to configure it. It shows a linter warning while browsing any file within a Django project:

no-member: User class has no member objects for below code.

on code like the following:

from django.contrib.auth.models import User

user_list = User.objects.all()
Rich Churcher
  • 7,361
  • 3
  • 37
  • 60
Ganesh
  • 3,128
  • 2
  • 17
  • 27

2 Answers2

7

After some research I found the solution. If you have installed everything correctly including w0rp's ale, pylint & pylint-django. In your vimrc add the following line & have fun developing web apps using django. Thanks.

let g:ale_python_pylint_options = '--load-plugins pylint_django'
Ganesh
  • 3,128
  • 2
  • 17
  • 27
2

A simpler per-project way is to install pylint_django and use a pylintrc file.

pip install pylint-django

Create a pylintrc file:

[MASTER]
load-plugins=pylint_django
django-settings-module=myproject.settings

Replace myproject with your project name.

Hritik
  • 673
  • 1
  • 6
  • 24