开发者

Django wsgi setup centos5.5

While trying to connect through the browser to my django app I'm getting the following exceptions (in var/log/httpd/error_log):

[Fri Jun 10 18:02:03 2011] [error] [client 167.206.188.3] mod_开发者_StackOverflowwsgi (pid=3550): Exception occurred processing WSGI script '/var/www/cgi-bin/django.wsgi'.
[Fri Jun 10 18:02:03 2011] [error] [client 167.206.188.3] TypeError: __init__() takes exactly 1 argument (3 given)
[Fri Jun 10 18:02:04 2011] [error] [client 167.206.188.3] mod_wsgi (pid=3551): Exception occurred processing WSGI script '/var/www/cgi-bin/django.wsgi'.
[Fri Jun 10 18:02:04 2011] [error] [client 167.206.188.3] TypeError: __init__() takes exactly 1 argument (3 given)

this is the content of /var/www/cgi-bin/django.wsgi:

import os
import sys

paths = ['/usr/lib/python2.6/site-packages/', '/usr/lib/python2.6/site-packages/django/', '/usr/lib/python2.6/site-packages/django/reuters' ]
for path in paths:
    if path not in sys.path:
        sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE']='reuters.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler

and the contents of: /etc/httpd/conf.d/python26-mod_wsgi.conf:

<IfModule !python_module>
    <IfModule !wsgi_module>
        LoadModule wsgi_module modules/python26-mod_wsgi.so
        WSGIPythonEggs /var/www/.python-eggs/
    </IfModule>
</IfModule>

<VirtualHost *:80>
    Alias /static /usr/lib/python2.6/site-packages/django/reuters/rca/static

    # WSGI Settings
    WSGIScriptAlias / /var/www/cgi-bin/django.wsgi

    <Directory "/var/www/cgi-bin">
        # Allow Apache to follow links
        Options FollowSymLinks
        # Turn on the ability to use .htaccess files
        AllowOverride All
        # Controls who can get stuff from this directory
        Order allow,deny
        Allow from all
    </Directory>

    <Directory "/usr/lib/python2.6/site-packages/django/reuters/rca/static">
        # Allow Apache to follow links
        Options FollowSymLinks
        # Turn on the ability to use .htaccess files
        AllowOverride All
        # Controls who can get stuff from this directory
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>


try

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

(You're missing the parentheses.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜