Django in Eclipse+PyDev, lot's of functions and imports are undefined/unresolved

348 views
Skip to first unread message

Chris Pagnutti

unread,
Oct 26, 2012, 12:48:35 PM10/26/12
to django...@googlegroups.com
Hi.  I created a django project using the eric4 IDE.  I'm just trying to transfer everything over to Eclipse+PyDev.  I basically just rebuilt the whole project from scratch by copying and pasting all the source code.  I'm pretty sure I set up my python interpreter fine.  I'm using django-trunk in a virtual env.

When I open the console in Eclipse, and can import django and it prints the correct version number.  But my project, which worked fine in eric4, makes Eclipse complain about unresolved imports and undefined variables.  Here a list of a few that might give some clue as to what's wrong:
from django.conf.urls import patterns, url
from django.conf import settings
from django.contrib import admin

urlquote
send_mail
_user_has_perm

among a whole bunch of others.

I thought it might have something to do with the auto-reload, but I followed this http://pydev.org/manual_adv_django.html (scroll to bottom), but it still doesn't work.

Any thoughts would be great.

Nick Santos

unread,
Oct 26, 2012, 2:34:39 PM10/26/12
to django...@googlegroups.com
I don't have a solution, but I can indicate that the same thing has happened to me on a standard install of Python 2.7.2 (no virtualenv) on Windows 7, so I don't know that it's anything about your setup in particular, if that helps.
-Nick



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/kDtwvXBFp4cJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Chris Pagnutti

unread,
Oct 26, 2012, 8:05:26 PM10/26/12
to django...@googlegroups.com
It turns out that, although eclipse is complaining a lot, the site runs just fine.  I guess I'll just have to get used to ignoring eclipse complaints when working with django.  Thanks.

Andrew McHarg

unread,
Oct 26, 2012, 8:16:18 PM10/26/12
to django...@googlegroups.com
Have you verified that the python interpreter pydev is looking at has django installed in it? That might account for it. Also try doing a Project > Clean. That being said I have found that pydev's code analysis can be pretty janky under a variety circumstances such as switching branches outside the IDE.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/6zMdzvPEVAUJ.

Chris Pagnutti

unread,
Oct 26, 2012, 10:17:28 PM10/26/12
to django...@googlegroups.com
Yeah, I'm quite sure the interpreter can see django.  I can verify it from the console, and the app runs fine, despite all the complaints, so I'm not too worried about it.  What does Project > Clean do?
Reply all
Reply to author
Forward
0 new messages