我想用FastCGI在iPage.com上设置django共享托管,但我一直在遇到问题。 CGI脚本在浏览器中作为文本而不是执行。下面是的.htaccess和FCGI脚本在共享的FastCGI主机上托管Django
.htacess
AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cgi-bin/mysite.fcgi/$1 [QSA,L]
,并在下面的FCGI脚本
#!/usr/bin/python
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/home/users/web/b2374/ipg.navtejportfoliocom/django")
# Switch to the directory of your project. (Optional.)
os.chdir("/home/user/myproject")
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "tej.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
什么我不这样做对吗?
fcgi不能在根文件夹上工作,所以我决定将它复制到CGI。加上djangoproject建议使用fcgi作为django,因为cgi包含对每个加载的页面的python + django +内容的调用,而fcgi消除了重新制作 – 2010-07-27 06:05:24