Django中,Apache和mod_wsgi的 [英] Django, apache and mod_wsgi

查看:234
本文介绍了Django中,Apache和mod_wsgi的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想部署一个Apache网络服务器与一个Django安装。

我已经安装了Apache 2.2.25(工作),并mod_wsgi的3.5。

在我的错误日志中我得到

  [太阳10月5 2014年10时09分10秒] [声明]的Apache / 2.2.25(Win32的)的mod_wsgi / 3.5的Python / 3.4.1配置 - 恢复正常运作

所以,我认为有些事情可能是工作。

当我去 HTTP的问题就出现了://本地主机/ 。我收到了 500内部服务器错误

错误日志说:

  [太阳10月5 2014年10时09分10秒] [声明]的Apache / 2.2.25(Win32的)的mod_wsgi / 3.5的Python / 3.4.1配置 - 恢复正常运作
[太阳10月5 2014年10时09分10秒] [声明] Server内置:2013年7月10日1时52分十二秒
[太阳10月5 2014年10时09分10秒] [声明]家长:创建子进程5832
httpd.exe:无法可靠地确定了服务器的完全合格的域名,使用192.168.0.19对于ServerName
httpd.exe:无法可靠地确定了服务器的完全合格的域名,使用192.168.0.19对于ServerName
[太阳10月5 2014年10时09分10秒] [声明]儿童5832:儿童进程正在运行
[太阳10月5 2014年10时09分10秒] [声明]儿童5832:后天开始互斥。
[太阳10月5 2014年10时09分10秒] [声明]儿童5832:64开始工作线程。
[太阳10月5 2014年10时09分10秒] [声明]儿童5832:启动线程侦听端口80。
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]的mod_wsgi(PID = 5832):发生异常处理WSGI脚本'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py 。
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]回溯(最近通话最后一个):\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,359线,在urlconf_module \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]返回self._urlconf_module \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] AttributeError的:RegexURLResolver'对象有没有属性'_urlconf_module'\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]在上面的异常处理,另一个异常:\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]回溯(最近通话最后一个):\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理wsgi.py,168线,在__call __ \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] self.load_middleware(个)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理base.py46行,在load_middleware \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] mw_instance = mw_class(个)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\中间件\\\\ locale.py23行,在__init __ \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]为url_pattern在get_resolver(无).url_patterns:\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,367线,在url_patterns \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]模式= GETATTR(self.urlconf_module,URL模式,self.urlconf_module)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,361线,在urlconf_module \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] self._urlconf_module = import_module(self.urlconf_name)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库\\\\导入库__ init__.py,线109,在import_module \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]返回_bootstrap._gcd_import(名称[级别:],包装,等级)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2254,在_gcd_import \\ r
[太阳10月5日10时09分14秒2014] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2237,在_find_and_load \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2226,在_find_and_load_unlocked \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1200,在_load_unlocked \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1129,在_exec \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1471,在exec_module \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路321,在_call_with_frames_removed \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ \\\\用户名\\\\ \\\\的Dropbox myproject的\\\\ \\\\ MyProject的urls.py,8号线,在<&模块GT; \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] admin.autodiscover(个)\\ r
[太阳10月5日10时09分14秒2014] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理__ init__.py23行,在自动发现\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] autodiscover_modules('管理',register_to =网站)\\ r
[太阳10月5日10时09分14秒2014] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ utils的\\\\ module_loading.py67行,在autodiscover_modules \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]为APP_CONFIG在apps.get_app_configs():\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,137行,在get_app_configs \\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] self.check_apps_ready(个)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,线路124,在check_apps_ready \\ r
[太阳10月5日10时09分14秒2014] [错误] [客户端127.0.0.1]筹集鸭pregistryNotReady(应用程序不加载呢。)\\ r
[太阳10月5 2014年10点09分14秒] [错误] [客户端127.0.0.1] django.core.exceptions.Ap pregistryNotReady:应用是没有载入\\ r

所以,问题似乎是 AttributeError的:RegexURLResolver'对象有没有属性'_urlconf_module'\\ r 。首先,我想这一定是东西与我的项目,所以我试着不加载任何应用程序,但即使有一个干净的Django项目它所造成的问题(如果它与正常的Django开发服务器的工作原理我已经检查)。

有人能看到我在做什么错了?

修改(省略时,错误日志 admin.autodiscover() urls.py

  [太阳10月5 2014年10时31分51秒] [声明]的Apache / 2.2.25(Win32的)的mod_wsgi / 3.5的Python / 3.4.1配置 - 恢复正常运作
[太阳10月5日10时31分51秒2014] [声明] Server内置:2013年7月10日1时52分十二秒
[太阳10月5 2014年10时31分51秒] [声明]家长:创建子进程5492
httpd.exe:无法可靠地确定了服务器的完全合格的域名,使用192.168.0.19对于ServerName
httpd.exe:无法可靠地确定了服务器的完全合格的域名,使用192.168.0.19对于ServerName
[太阳10月5 2014年10时31分51秒] [声明]儿童5492:儿童进程正在运行
[太阳10月5 2014年10点31分52秒] [声明]儿童5492:后天开始互斥。
[太阳10月5 2014年10点31分52秒] [声明]儿童5492:64开始工作线程。
[太阳10月5 2014年10点31分52秒] [声明]儿童5492:启动线程侦听端口80。
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]的mod_wsgi(PID = 5492):发生异常处理WSGI脚本'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py 。
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]回溯(最近通话最后一个):\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,359线,在urlconf_module \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]返回self._urlconf_module \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] AttributeError的:RegexURLResolver'对象有没有属性'_urlconf_module'\\ r
[太阳10月5日10时32分零零秒2014] [错误] [客户端127.0.0.1] \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]在上面的异常处理,另一个异常:\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] \\ r
[太阳10月5日10时32分零零秒2014] [错误] [客户端127.0.0.1]回溯(最近通话最后一个):\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理wsgi.py,168线,在__call __ \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] self.load_middleware(个)\\ r
[太阳10月5日10时32分零零秒2014] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理base.py46行,在load_middleware \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] mw_instance = mw_class(个)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\中间件\\\\ locale.py23行,在__init __ \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]为url_pattern在get_resolver(无).url_patterns:\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,367线,在url_patterns \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]模式= GETATTR(self.urlconf_module,URL模式,self.urlconf_module)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,361线,在urlconf_module \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] self._urlconf_module = import_module(self.urlconf_name)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库\\\\导入库__ init__.py,线109,在import_module \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]返回_bootstrap._gcd_import(名称[级别:],包装,等级)\\ r
[太阳10月5日10时32分零零秒2014] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2254在_gcd_import \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2237,在_find_and_load \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路2226,在_find_and_load_unlocked \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1200,在_load_unlocked \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1129,在_exec \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路1471,在exec_module \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件<冷冻importlib._bootstrap>中,线路321,在_call_with_frames_removed \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ \\\\用户名\\\\ \\\\的Dropbox myproject的\\\\ \\\\ MyProject的urls.py,10号线,在<&模块GT; \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] URL(R'^管理员/',包括:(admin.site.urls)),\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,260线,在URL中\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]返回self.get_urls(),self.app_name,self.name \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,线路221,在get_urls \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] self.check_dependencies(个)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,159线,在check_dependencies \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]如果不是apps.is_installed('django.contrib.admin'):\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,223线,在is_installed \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] self.check_apps_ready(个)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\ lib目录站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,线路124,在check_apps_ready \\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1]筹集鸭pregistryNotReady(应用程序不加载呢。)\\ r
[太阳10月5 10:32:00 2014年] [错误] [客户端127.0.0.1] django.core.exceptions.Ap pregistryNotReady:应用是没有载入\\ r

修改2:

  WSGIScriptAlias​​ / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/用户/用户名/ Dropbox的/ myproject的<目录C:/用户/用户名/ Dropbox的/ myproject的/ myproject的>
<文件wsgi.py>
为了否认,允许
所有允许
< /文件>
< /目录>

我的 wsgi.py

 导入OS
进口SYSos.environ ['DJANGO_SETTINGS_MODULE'] ='myproject.settings'从django.core.handlers.wsgi进口WSGIHandler应用= WSGIHandler()

修改3(2014年10月7日):

使用Python的2.7我得到错误:

  [周二07年10月2014年11时55分19秒] [提醒]的mod_wsgi:编译为Python / 2.7.6。
[星期二07年10月2014年11点55分19秒] [提醒] mod_wsgi的:使用Python / 2.7.8运行。
[星期二07年10月2014年11点55分19秒] [声明]的Apache / 2.2.25(Win32的)的mod_wsgi / 3.5的Python / 2.7.8配置 - 恢复正常运作
[星期二07年10月2014年11点55分19秒] [声明] Server内置:2013年7月10日1时52分十二秒
[星期二07年10月2014年11点55分19秒] [声明]家长:创建子进程5824
[星期二07年10月2014年11点55分19秒] [提醒]的mod_wsgi:编译为Python / 2.7.6。
[星期二07年10月2014年11点55分19秒] [提醒] mod_wsgi的:使用Python / 2.7.8运行。
[星期二07年10月2014年11点55分19秒] [声明]儿童5824:儿童进程正在运行
[星期二10月7日11点55分20秒2014] [声明]儿童5824:后天开始互斥。
[星期二07年10月2014年11点55分20秒] [声明]儿童5824:64开始工作线程。
[星期二07年10月2014年11点55分20秒] [声明]儿童5824:启动线程侦听端口80。
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]的mod_wsgi(PID = 5824):发生异常处理WSGI脚本'C:/Users/sgan/Dropbox/myproject/myproject/wsgi.py 。
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]回溯(最近通话最后一个):
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理wsgi.py,168线,在__call__
[星期二10月7日11时55分25秒2014] [错误] [客户端127.0.0.1] self.load_middleware()
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ \\\\处理base.py46行,在load_middleware
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] mw_instance = mw_class()
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\中间件\\\\ locale.py23行,在__init__
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]在get_resolver(无).url_patterns url_pattern:
[星期二10月7日11时55分25秒2014] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,367线,在url_patterns
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]模式= GETATTR(self.urlconf_module,URL模式,self.urlconf_module)
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\核心\\\\ urlresolvers.py,361线,在urlconf_module
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] self._urlconf_module = import_module(self.urlconf_name)
[星期二10月7日11时55分25秒2014] [错误] [客户端127.0.0.1]文件C:\\\\ Python27 \\\\ \\\\库\\\\导入库__ init__.py37行,在import_module
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] __import __(姓名)
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ \\\\用户\\\\ sgan Dropbox的\\\\ \\\\的myproject myproject的\\\\ urls.py,9号线,在<&模块GT;
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] URL(R'^管理员/',包括:(admin.site.urls))
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,260线,在URL中
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]返回self.get_urls(),self.app_name,self.name
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,线路221,在get_urls
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] self.check_dependencies()
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\的contrib \\\\ \\\\管理sites.py,159线,在check_dependencies
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]如果不是apps.is_installed('django.contrib.admin'):
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,223线,在is_installed
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1] self.check_apps_ready()
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]文件C:\\\\ Python34 \\\\ \\\\库站点包\\\\的Django 1.7 py3.4.egg \\\\的Django \\ \\ APPS \\\\ registry.py,线路124,在check_apps_ready
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]筹集鸭pregistryNotReady(应用程序不加载呢。)
[星期二07年10月2014年11点55分25秒] [错误] [客户端127.0.0.1]鸭pregistryNotReady:应用程序尚未加载。

在Apache配置为

  WSGIScriptAlias​​ / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/用户/用户名/ Dropbox的/ myproject的; C:/ Python27; C:/ Python27 /库<目录C:/用户/用户名/ Dropbox的/ myproject的/ myproject的>
<文件wsgi.py>
为了否认,允许
所有允许
#Require授予所有
< /文件>
< /目录>


解决方案

的问题是创建WSGI应用程序的正确方法是Django的1.6和1.7之间的编辑,以

 从django.core.wsgi进口get_wsgi_application
应用= get_wsgi_application()

现在它工作在两个Python 2.7版和Python 3.4

I am trying to deploy an Apache webserver with a Django installation.

I have installed Apache 2.2.25 (is working) and mod_wsgi 3.5.

In my error log I get

[Sun Oct 05 10:09:10 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations

So I think something might be working.

The problem arises when I go to http://localhost/. I get a 500 Internal Server Error.

The error log says:

[Sun Oct 05 10:09:10 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations
[Sun Oct 05 10:09:10 2014] [notice] Server built: Jul 10 2013 01:52:12
[Sun Oct 05 10:09:10 2014] [notice] Parent: Created child process 5832
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Child process is running
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Acquired the start mutex.
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Starting 64 worker threads.
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Starting thread to listen on port 80.
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5832): Exception occurred processing WSGI script 'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py'.
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 359, in urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     return self._urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] During handling of the above exception, another exception occurred:\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self.load_middleware()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     return _bootstrap._gcd_import(name[level:], package, level)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1129, in _exec\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1471, in exec_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Users\\Username\\Dropbox\\myproject\\myproject\\urls.py", line 8, in <module>\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     admin.autodiscover()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\__init__.py", line 23, in autodiscover\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     autodiscover_modules('admin', register_to=site)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\utils\\module_loading.py", line 67, in autodiscover_modules\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     for app_config in apps.get_app_configs():\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 137, in get_app_configs\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self.check_apps_ready()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.\r

So the problem seems to be AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r. First I thought it must be something with my project, so I've tried not loading any apps, but even with a clean django project it causes the problem (I have checked if it works with the normal django development server).

Can anyone see what I am doing wrong?

Edit (error log when omitting admin.autodiscover() from urls.py):

[Sun Oct 05 10:31:51 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations
[Sun Oct 05 10:31:51 2014] [notice] Server built: Jul 10 2013 01:52:12
[Sun Oct 05 10:31:51 2014] [notice] Parent: Created child process 5492
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
[Sun Oct 05 10:31:51 2014] [notice] Child 5492: Child process is running
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Acquired the start mutex.
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Starting 64 worker threads.
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Starting thread to listen on port 80.
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5492): Exception occurred processing WSGI script 'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py'.
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 359, in urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return self._urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] During handling of the above exception, another exception occurred:\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.load_middleware()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return _bootstrap._gcd_import(name[level:], package, level)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1129, in _exec\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1471, in exec_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Users\\Username\\Dropbox\\myproject\\myproject\\urls.py", line 10, in <module>\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     url(r'^admin/', include(admin.site.urls)),\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 260, in urls\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return self.get_urls(), self.app_name, self.name\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 221, in get_urls\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.check_dependencies()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 159, in check_dependencies\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     if not apps.is_installed('django.contrib.admin'):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 223, in is_installed\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.check_apps_ready()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.\r

Edit 2:

WSGIScriptAlias / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/Users/Username/Dropbox/myproject

<Directory C:/Users/Username/Dropbox/myproject/myproject>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

My wsgi.py:

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

from django.core.handlers.wsgi import WSGIHandler

application = WSGIHandler()

Edit 3 (10-07-2014):

With Python 2.7 I get the error:

[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Compiled for Python/2.7.6.
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Runtime using Python/2.7.8.
[Tue Oct 07 11:55:19 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
[Tue Oct 07 11:55:19 2014] [notice] Server built: Jul 10 2013 01:52:12
[Tue Oct 07 11:55:19 2014] [notice] Parent: Created child process 5824
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Compiled for Python/2.7.6.
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Runtime using Python/2.7.8.
[Tue Oct 07 11:55:19 2014] [notice] Child 5824: Child process is running
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Acquired the start mutex.
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Starting 64 worker threads.
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Starting thread to listen on port 80.
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5824): Exception occurred processing WSGI script 'C:/Users/sgan/Dropbox/myproject/myproject/wsgi.py'.
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.load_middleware()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python27\\Lib\\importlib\\__init__.py", line 37, in import_module
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     __import__(name)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Users\\sgan\\Dropbox\\myproject\\myproject\\urls.py", line 9, in <module>
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     url(r'^admin/', include(admin.site.urls)),
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 260, in urls
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     return self.get_urls(), self.app_name, self.name
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 221, in get_urls
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.check_dependencies()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 159, in check_dependencies
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     if not apps.is_installed('django.contrib.admin'):
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 223, in is_installed
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.check_apps_ready()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] AppRegistryNotReady: Apps aren't loaded yet.

The Apache configuration is

WSGIScriptAlias / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/Users/Username/Dropbox/myproject;C:/Python27;C:/Python27/Lib

<Directory C:/Users/Username/Dropbox/myproject/myproject>
<Files wsgi.py>
Order deny,allow
Allow from all
#Require all granted
</Files>
</Directory>

解决方案

The problem was that the correct way to create the wsgi app was edited between django 1.6 and 1.7 to

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Now it works in both python 2.7 and python 3.4

这篇关于Django中,Apache和mod_wsgi的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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