0
我想在使用fcgi的專用服務器上部署第二個Django項目。但是,如果我在我的項目運行python manage.py runfcgi
我得到以下的輸出:Django的項目與fcgi
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: 500 INTERNAL SERVER ERROR
Vary: Accept-Language, Cookie
Content-Type: text/html; charset=utf-8
Content-Language: en-us
再加上正確的HTML輸出。
我的.htaccess是這樣的:
RewriteEngine On
RewriteRule ^media/(.*)$ /home/username/public_html/my_project/media/$1 [L]
RewriteRule ^admin_media/(.*)$ /home/username/public_html/my_project/admin_media/$1 [L]
RewriteRule ^(django\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ cgi-bin/django.fcgi/$1 [L]
而且我django.fcgi是:
#!/usr/local/bin/python2.6
import sys
import os
# insert PYTHONPATH values here, including the path to your application
sys.path.insert(0, '/home/darwinfo/lib/python/')
sys.path.insert(0, '/home/darwinfo/django-projects/my_project/')
# location of your application's settings file.
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_project.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method = "threaded", daemonize = "false", maxchildren=3, minspare=0, maxspa
re=1)
當我瀏覽到網址我得到一個500錯誤。我不相信這是一個Django的錯誤,因爲我的管理員郵件配置正確,我沒有收到通知。
任何建議我能做些什麼來改善這種狀況