On Fri, Feb 6, 2009 at 10:31 AM, djandrow <andrewkenyon...@gmail.com> wrote:

>
> So i set it in Environment Variable then System variables [this is on
> windows]:
>
> PythonPath -- C:\ProgLangs\Python26
>
> But i still get File
>
>  "C:\ProgLangs\Python25\Lib\site-packages\mod_python\importer.py",
> line 304, in import_module
>    return __import__(module_name, {}, {}, ['*'])"
>
> How can I set the path to get it to look in the Python26?
> I have a feeling i'm being a bit slow here.
>

Apparently the mod_python you have installed in your Apache is a Python 2.5
version.  The mod_python module is bound to a specific Python version.  You
cannot make a mod_python for Python 2.5 binary run under Python 2.6, you
would need to rebuild mod_python from source (building against Ptyhon 2.6)
or obtain a mod_python for Python 2.6 binary from somewhere.

So, if you want to use this mod_python with Django, then your project will
be running under Python 2.5, not 2.6, and you will need to either install
Django under the Python25 site-packages tree (which is automatically
searched for imports), or put Django in some neutral place and point to it
in your PythonPath Apache directive (in the same way you point to your
project code).

BTW your earlier spec for the PythonPath directive you are using showed you
are putting your project code under the default Apache document root htdocs
-- that is a bad idea as it may make your source code (including sensitive
stuff like database password in settings.py) easily accessible from the web,
depending on exactly how you have Apache configured.  Your Django project
source code does not need to be under Apache's document root, it simply
needs to be found via the PythonPath you specify in your Apache Location
block for your Django project.

Karen

--~--~---------~--~----~------------~-------~--~----~
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