文件不存在:/var/www/polls

File does not exist: /var/www/polls

/var/www

中 example.wsgi 个文件的内容
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('~/.virtualenvs/menv/local/lib/python2.7/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('/var/www/example')
sys.path.append('/var/www/example/example')
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
# Activate your virtual env
activate_env=os.path.expanduser("~/.virtualenvs/menv/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

example.conf

的内容
<VirtualHost *:80>
ServerAdmin webmaster@mydomain.com
ServerName example.redirectme.net
ServerAlias www.example.redirectme.net
WSGIScriptAlias / /var/www/example.wsgi
<Directory /var/www/polls>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

polls 是示例项目中应用程序的名称

如果 polls 是示例项目中应用程序的名称,您的 example.conf 文件可能应该包含以下行:

<Directory /var/www/example/polls>

而不是这个:

<Directory /var/www/polls>

感谢您的帮助。我已经解决了这个问题。一切都是正确的。 我创建的 conf 文件未启用。所以我运行下面的命令。

a2ensite example.conf