tags:

views:

265

answers:

2

I am using pylint,

pylint -e app/views.py

Gives me errors like

E: 3: No name 'shortcuts' in module 'django' E: 7: No name 'db' in module 'django'

But passes for other django imports. Since it passes for other Django import Django is on my pythonpath.

A: 

I think I figured it out -- if you jump into a python session and actually try to import anything from django.db

from django.db import *

you'll get an error about DJANGO_SETTINGS_MODULE not being set. Setting the environment variable and pointing it to your settings.py like app.settings should fix the error for you.

When I tried this in an Eclipse/PyDev config I had to disable pylint, build, then re-enable pylint to finally clear out those errors.

jtjin
TRied setting the values, but still get the same errors.
uswaretech
A: 

have you tried djangolint, which is a wrapper around Pylint with Django-specific settings ?

-> http://chris-lamb.co.uk/projects/django-lint/

gurney alex