On 7 September 2010 23:33, [email protected] <[email protected]> wrote: > > On Sep 7, 2010, at 8:59 AM, Aza wrote: > >> Thanks Graham, your video presentation is really quite informative. >> If I can just ask a more Linux related question, why is it that the >> Python Interpreter has access to Django modules in my home >> directories, and Apache does not? > > Which "the Python interpreter?" > > Apache runs under a specified user, specifically to use an unprivileged user > for web serving. > > Python, from the command line anyway, is running as you, so of course it has > access to your home directory.
Potentially a bit more to it than that. Reasons why are: 1. When using command line, you are relying on PYTHONPATH environment variable for finding where Django modules are installed. You would need to use one of the available methods for telling mod_wsgi additional locations to look as it is not going to consult your PYTHONPATH environment variable. 2. The user that Apache runs as, or which you have nominated a daemon mode process should run as, doesn't have permissions to read the directory where Django modules are. 3. The command line Python isn't the same Python installation as mod_wsgi is compiled against and using. This is because mod_wsgi is hard wired to a version of Python. It might be compiled against 2.5 but on command line you are using 2.6. This though usually relates to packages installed in site-packages of Python installation. 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.
