I'm putting a Pinax-based app on WebFaction using mod_python.  It's
generating
these errors in the apache error log:

http://dpaste.com/1966/

This is probably an apache configuration or settings.py or path issue
because I don't get the error
with the dev server.   The directory structure is as follows:

~/webapps/django/myproject/      contains settings.py and my app
~/webapps/django/pinax-0.5.1/     contains /apps  and /libs  - all the
pinax apps and python libs needed

Here's the httpd.conf:

ServerRoot "/home/adriannye/webapps/django/apache2"

LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule python_module modules/mod_python.so
LoadModule rewrite_module modules/mod_rewrite.so

KeepAlive Off
Listen 8133
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
CustomLog logs/access_log combined
ServerLimit 2

<Location "/">
    PythonHandler myproject.deploy.modpython
    PythonDebug On
    PythonPath "['/home/adriannye/webapps/django', '/home/adriannye/
webapps/django/pinax-0.5.1', '/home/adriannye/webapps/django/lib/
python2.5'] + sys.path"
    SetEnv DJANGO_SETTINGS_MODULE myproject.settings
    SetHandler python-program
</Location>
<Location "/site_media">
    SetHandler None
</Location>


The myproject.deploy.modpython handler is the one that comes with
PINAX - it sets the PYTHONPATH to include all the apps and libraries
it needs, then calls the django handler.   Here it is:

import os
import sys
import logging

from os.path import abspath, dirname, join
from site import addsitedir

from django.core.handlers.modpython import ModPythonHandler

PINAX_ROOT = abspath(join(dirname(__file__), "../../pinax-0.5.1/"))
PROJECT_ROOT = abspath(join(dirname(__file__), "../"))

class PinaxModPythonHandler(ModPythonHandler):
    def __call__(self, req):
        path = addsitedir(join(PINAX_ROOT, "libs/external_libs"), set
())
        if path:
            sys.path = list(path) + sys.path

        sys.path.insert(0, join(PINAX_ROOT, "apps/external_apps"))
        sys.path.insert(0, join(PINAX_ROOT, "apps/local_apps"))
        sys.path.insert(0, join(PROJECT_ROOT, "apps"))

        sys.path.insert(0, abspath(join(dirname(__file__), "../../")))

        return super(PinaxModPythonHandler, self).__call__(req)

def handler(req):
    # mod_python hooks into this function.
    return PinaxModPythonHandler()(req)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to