在此服务器上找不到/home/~USER/public_html/django.fcgi/

时间:2013-06-26 16:45:55

标签: django apache .htaccess fastcgi

这让我发疯了。我的.htaccess是

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

我的django.fcgi看起来不错

#!/usr/bin/python
import os, sys
PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'/home/USER/django-example-project/example_website'))
venv = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'/home/USER/django-example-project/venv/bin/activate_this.py'))
execfile(venv, dict(__file__=venv))
sys.path.insert(0, "{0}/../example_website".format(PROJECT_PATH))
os.environ['DJANGO_SETTINGS_MODULE'] = "example_website.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

当我放入浏览器http://localhost/~USER时,它会给我错误

The requested URL /home/~USER/public_html/django.fcgi/ was not found on this server.

为什么我收到此错误。 我的.htacces和django.fcgi都在public_html目录中。我尝试了很多东西,但总是这样:(

0 个答案:

没有答案