Hi folks,

Due to the fact that mod_python is unmaintained, I've started looking
into porting the app to mod_wsgi. In the current apache rules, we
have:
"""
<Location ~ "/(afe|new_tko)/server">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE frontend.settings
    PythonDebug On
    # Force our own site-packages to be loaded by mod_python prior
    # to mod_python's system python site-packages directory.
    # This way our code can depend on library versions other than
    # those available as packages on various OS distributions.
    PythonPath "['/usr/local/autotest/site-packages',
'/usr/local/autotest', '/usr/lib/python2.7/site-packages/autotest',
'/usr/lib/python2.6/site-packages/autotest',
'/usr/lib/python2.5/site-packages/autotest',
'/usr/lib/python2.4/site-packages/autotest'] + sys.path"
</Location>
"""

Which, as far as I could grasp from the references to make the port,
yield the following .wsgi app:

 /usr/local/autotest/frontend/frontend.wsgi
"""
import os, sys

try:
    import autotest.common
except ImportError:
    frontend_dir = os.path.dirname(sys.modules[__name__].__file__)
    sys.path.insert(0, frontend_dir)
    import common
    sys.path.pop(0)

path_list = ['/usr/local/autotest/site-packages', '/usr/local/autotest',
             '/usr/lib/python2.7/site-packages/autotest',
             '/usr/lib/python2.6/site-packages/autotest',
             '/usr/lib/python2.5/site-packages/autotest',
             '/usr/lib/python2.4/site-packages/autotest']

for p in path_list:
    if os.path.isdir(p):
        sys.path.append(p)

os.environ['DJANGO_SETTINGS_MODULE'] = 'autotest.frontend.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()
"""

And the location snippet in django-directives would simply turn to:

"""
WSGIScriptAlias /(afe|new_tko)/server /usr/local/autotest/frontend/frontend.wsgi
"""

But well, that is not working. I'm posting this in the hopes that
someone that already done such ports would be able to help us out.

Cheers,

-- 
Lucas
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to