2009/2/10 Stu.Axon <[email protected]>:
>
> Hi,
>  I just installed apache and mod_wsgi.
>
> I can have a very simple handler, but when I try and import it says
>
>  File "C:/django/test/apache/django.wsgi", line 3, in <module>
>    import os, sys
> ImportError: No module named os
>
>
> I've looked around a bit, but haven't found any relevant info.
>
> I can upload a copy of httpd.conf somewhere if it would help, my
> hander looks like this:
>
>
>
> #!/usr/bin/python
>
> import os, sys
> sys.stdout = sys.stderr
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
> ## EOF
>
> Cheers :)

Write a command line Python script which imports 'os' module and tries
to do something. This looks a lot like the registry entries defining
where Python looks for modules has been screwed up or there aren't
any.

This latter might happen for example if you install Python as yourself
rather than Administrator, meaning that user that Apache runs as
doesn't have access to registry configuration as it is against you
rather than the machine as a whole.

If Python was installed as you, without Administrator privilege,
uninstall Python and reinstall as someone with Administrator
privilege.

Another possibility is that you have multiple versions of Python
installed, with some being self contained versions as part of some
third party application. If the Python DLL from those application
bundled versions are being found in PATH before the correct one by
Apache, it can screw things up.

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to