python - Django + Eclipse, shell issues -
i'm using pydev use django in eclipse. i'm following tutorial here (http://docs.djangoproject.com/en/dev/intro/tutorial01/), making simple poll application. in example when run shell able this:
from polls.models import poll, choice
however, reason, i'm not able this. in order work, have this:
from projectname.polls.models import poll, choice
any idea why is? eclipse thing? path wrong somewhere in settings.py? thanks!
i'm assuming you're using pydev. see how pythonpath structured...
(right click on project in package explorer > properties > pydev - pythonpath.
if project set as
project_root/ +-projectname/ +-polls/ +-models.py
and if pythonpath points project_root
, you'll have refer poll class projectname.polls.models.poll
. however, if set pythonpath projectname
, can refer it polls.models.poll
.
Comments
Post a Comment