WSGIServer:缺少FastCGI参数

时间:2013-05-12 18:25:40

标签: django fastcgi wsgiserver

我目前正在尝试使用Django设置我的第一个主页并遇到了一些问题。

我的项目服务器是在FastCGI模式下运行Django,他们为我提供了一个快速指南来设置运行Django所需的设置,看起来像这样。

mysite.fcgi

#!/usr/bin/local/python
import sys, os

sys.path.append("/home/users/username")

from django.core.handler.wsgi import WSGIHandler
from flup.server.fcgi import WSGIServer

os.chdir("/home/users/username/mysite")

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

WSGIServer(WSGIHandler()).run()

的.htaccess

Addhandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

当我运行 manage.py runfcgi 时,我收到此消息:

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 200 OK
Content-Type: text/html; charset=utf-8

<!-- The html from my main template --!>

非常感谢帮助:)

0 个答案:

没有答案