【发布时间】:2011-05-24 01:54:07
【问题描述】:
Apache 和 mod_wsgi 配置正确(我创建了一个 hello world .html apache 文件和一个 hello world mod_wsgi 应用程序 没问题)。我现在需要我的 Django 应用程序来使用我的 django.wsgi 文件。是什么让我认为它无法识别我的 wsgi 文件是我 进入我创建的 django.wsgi 文件并完全删除了所有 文件中的代码并重新启动Apache,它仍然给了我 同一页面(来自 Django 应用程序的文件列表,不是我的实际 Django 应用程序。配置 Apache 和 mod_wsgi 非常顺利 但我不知道如何解决这个问题。以下是一些细节:
这是我当前的 django.wsgi 文件:
import os
import sys
sys.path.append('/srv/www/duckling.org/store/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'store.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
我尝试了几个不同版本的 django.wsgi 文件 (包括类似http://www.djangoproject.com/ 的版本)。 我的这个版本的 wsgi 来自这里: http://library.linode.com/frameworks/django-apache-mod-wsgi/ubuntu-10...
另外,下面是我的 vhost apache 配置文件。我认为这些 是应该为我完成这项工作的主要文件。如果.......请告知我们 你看到我正在做的任何错误以及我可能会做些什么来修复 这。 django 应用程序在 django 的内置开发中运行良好 服务器,所以我认为它可能与我的路径有关。 我的 apache error.log 文件中也没有错误。它的行为就像那里一样 完全没有问题,事实并非如此......项目没有加载, 就像我说的只是我的 Django 的文件和目录的列表 项目。这是我的 apache 配置文件:
<VirtualHost 1.2.3.4:80>
ServerAdmin hi@duckling.org
ServerName duckling.org
ServerAlias www.duckling.org
DocumentRoot /srv/www/duckling.org/store/
<Directory /srv/www/duckling.org/store/>
Order Allow,Deny
Allow from all
</Directory>
Alias /static/ /srv/www/duckling.org/store/static/
<Directory /srv/www/duckling.org/store/static>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias store/ /srv/www/duckling.org/store/wsgi-scripts/django.wsgi
<Directory /srv/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
这是我正在使用的堆栈版本,我在 mod_wsgi 网站,你们都想要我正在使用的版本 在服务器上:
Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.5 with Suhosin-Patch
mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8
谢谢, j.
【问题讨论】: