这让我发疯。我的 .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 目录中。我已经尝试了很多东西,但它总是表明这一点:(