Django FastCGI共享主机配置

时间:2013-12-13 13:00:30

标签: django apache .htaccess fastcgi

我正在尝试配置我的网络服务器,以便我可以使用FastCGI在其上运行我的Django应用程序。

这是我的设置生产服务器架构:

www/
    project/
        [other project files and folders]
        .htaccess
        .project.fcgi

project.fcgi

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

# Add a custom Python path.
sys.path.insert(0, "/path/to/my/python")

# 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'] = "project.settings.production"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

的.htaccess

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

现在,当我刷新页面时,我得到一个500 Internal Server Error

错误日志:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

因为我在共享主机上,所以我无权修改httpd.conf文件以便将日志设置为不同的级别,因此我没有太多信息来了解问题所在。

任何帮助都将受到高度赞赏。

0 个答案:

没有答案