After reading the wiki page about mod_python, threads in this group,
and the Django documentation, I finally got a mod_python setup working.
In the end, it's pretty simple, but figuring it out wasn't much fun. I
added an example to the bottom of the wiki page. I did that instead of
posting it here because I figure that is the first place most people
will look.

The example there doesn't run at the site root. I figured out that you
can run a project at the site root by removing all the DocumentRoot
stuff (leaving it in was causing infinite redirection) and just having
something like this in the top-level of the VirtualHost container:

SetHandler mod_python
PythonHandler mod_python.wsgi
PythonPath "['/path/to/project'] + sys.path"
PythonOption wsgi.application startup::app

With this setup you don't even have to do anything special to get at
stuff in the Pylons public directory. In my template I just have things
like href="/css/base.css". In the wiki example, I created an alias to
the public dir and the equivalent href is
"/project/public/css/base.css".

The only problem with this is when I go to http://example.com/ I get an
extra slash added at the end: http://example.com//. If I go to
something below the root, http://example.com/whatever, I don't get the
extra slash. The slash doesn't seem to affect anything, but it doesn't
look right.

References:
http://pylonshq.com/project/pylonshq/wiki/ModPython
http://groups.google.com/group/pylons-discuss/browse_thread/thread/1edda8b34f13511d/2aed674d12a9e53f
http://www.djangoproject.com/documentation/modpython/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to