Django的FastCGI的500内部服务器错误 [英] Django FastCGI and 500 Internal Server Error

查看:767
本文介绍了Django的FastCGI的500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图FastCGI的,但没有成功安装Django!它给了我一个500错误,但如果我执行我的./dispatch.fcgi壳牌它给我的它的作品! Django的的HTML页面。

下面是我的网址 http://mydjango.webmashing.com

和我的dispatch.fcgi文件

 #!的/ usr / bin中/蟒蛇
进口SYS,OS
sys.path.insert(0,/home/webmashi/.local/lib/python)
os.chdir(/家庭/ webmashi /。本地/ LIB /蟒蛇/ MyProject的)
os.environ ['DJANGO_SETTINGS_MODULE'] =myproject.settings
从django.core.servers.fastcgi进口runfastcgi
runfastcgi(方法=线程,以进程=假)
 

.htaccess文件:

 的AddHandler fcgid脚本.fcgi
RewriteEngine叙述上
的RewriteCond%{} REQUEST_FILENAME!-f
重写规则^(。*)$ dispatch.fcgi / $ 1 [QSA,L]
 

解决方案

我更新,从2.4我的Python版本2.6和它的工作:)

I tried to install Django with FastCGI but without success!. It gives me a 500 Error, but if I execute my ./dispatch.fcgi on shell it gives me the "it works!" HTML page of Django.

Here is my url http://mydjango.webmashing.com

and my dispatch.fcgi file is

#!/usr/bin/python
import sys, os
sys.path.insert(0, "/home/webmashi/.local/lib/python")
os.chdir("/home/webmashi/.local/lib/python/myproject")
os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

.htaccess file:

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

解决方案

I update my python version from 2.4 to 2.6 and it's worked :)

这篇关于Django的FastCGI的500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆