I've trimmed all but the pertinent bits below.

On Thu, 2008-12-11 at 15:16 -0800, Lee wrote:
[...]
> The django Project folder is IntelligentNotesSystem ( created by
> django-admin.py startproject IntelligentNotesSystem  ), which is
> located in C:\Django\IntelligentNotesSystem.
> 
> The application folder is Core (created by python manage.py startapp
> Core), which is located in C:\Django\IntelligentNotesSystem\Core.

[...]
> <Location "/IntelligentNotesSystem/">
>     SetHandler python-program
>     PythonHandler django.core.handlers.modpython
>     SetEnv DJANGO_SETTINGS_MODULE IntelligentNotesSystem.settings
>     PythonOption django.root /IntelligentNotesSystem
>     PythonDebug On
>     PythonPath "['C:/Django'] + sys.path"
> </Location>

[...]
> The application runs well in the django server(in this url 
> http://127.0.0.1:8000/).
> However, it displays :
> 
> 
> ImportError at /
> 
> No module named Core.forms

To be able to write "import Core" (or "from Core import ..."), the Core
directory's parent directory needs to be on your Python path. However,
you only added the parent of IntelligentSystemNotes to your Python path.
So you can write "from IntelligentSystemNotes import ..." and Python
will know what to do, since it can see that directory inside one of the
Python path directories. However, Python has no idea where Core is
located.

Solution: Add c:/Django/IntelligentSystemNotes/ to your Python path in
the Apache configuration.

The answer to almost every problem like this when configuring Apache and
seeing "no module named" is "check your Python path; you've almost
certainly left out something". :-)

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to