Tuesday, June 29, 2010

Re: Beginner nead help

Eduan,

This might be a little technical for a beginner, but you'll have to
learn sometime :)

Python looks for modules according to the python path. If your module
isn't available on the path, then you'll get an error like you are
seeing. I believe that manage.py adds the directory it is in to the
python path. However, it is looking inside the mysite folder for a
module called mysite, with a folder inside it called polls. (mysite/
mysite/polls). You either need to add the folder above the manage.py
file to the python path or rename the installed app to just "polls".

You can see your python path from the shell by typing:
import sys
print sys.path

Also, make sure anything that python should be looking at has an
__init__.py file in it. The __init__.py file is what makes a directory
a python module. Without that __init__.py file python will mostly
ignore it.

Hope that helps!
Alex

On Jun 29, 7:00 am, Eduan <bekker.ed...@gmail.com> wrote:
> Okay thanks that you all are so helpful.
> I went through the whole tutorial allot of times and can't even
> complete part 1.
> I thought that it was my setup that i was using.
> I am using Windows 7 and Eclipse SDK Version: 3.5.2 for my programming
> environment. I am using a MySQL 5.5 database.
>
> It all goes fluently till I get to the part where you add
> 'mysite.polls' under installed apps.
> After adding that in there I can't run any command(like
> syncdb,runserver) without getting back an error stating:
> Error: No module named mysite.polls.
> I tried renaming it and I still get that error.
>
> I have downloaded an full Django app called friends here :http://github.com/jtauber/django-friends/
> If I syncdb or runserver I get the similar error:
> Error: No module named friends
>
> Now please any help. This could be a simple beginners mistake that I
> am making. Thanks allot
> Eduan

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

No comments:

Post a Comment