Django奇怪的行为:无限加载所有视图,但django正在工作

时间:2017-02-07 17:14:46

标签: python django mod-wsgi

2年Django经验(1.8.12,Ubuntu 14.04)并且第一次遇到这个问题。

过了一段时间(不知道为什么)我来到我的网站并尝试加载一些页面:结果无限加载所有视图包括管理面板(无法登录)和所有外部视图。 “浏览器”选项卡显示加载圈,从不加载。

超级奇怪如下:我尝试添加\从settings.py删除一些应用程序,在我的代码中出错,添加\擦除一些导入,当我这样做时Django开始正常工作:它显示我标准错误页面(黄色-gray with traceback)。然后我去编码并修复错误 - 再次出现无限加载。

一旦今天我能够使我的视图正常工作 - 它正常加载(带有表单的简单视图)。但是不可能第二次重新加载这个视图 - 它加载一次,之后我再次无限加载所有其他尝试。

在Apache error.log 中,我看到:

    [Tue Feb 07 19:50:23.776657 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16966 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:23.776852 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16967 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:25.779159 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16966 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:25.779280 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16967 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:27.781572 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16966 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:27.781704 2017] [core:warn] [pid 16963:tid 139669519046528] AH00045: child process 16967 still did not exit, sending a SIGTERM
[Tue Feb 07 19:50:29.784028 2017] [core:error] [pid 16963:tid 139669519046528] AH00046: child process 16966 still did not exit, sending a SIGKILL
[Tue Feb 07 19:50:29.784174 2017] [core:error] [pid 16963:tid 139669519046528] AH00046: child process 16967 still did not exit, sending a SIGKILL
[Tue Feb 07 19:50:30.785515 2017] [mpm_event:notice] [pid 16963:tid 139669519046528] AH00491: caught SIGTERM, shutting down
[Tue Feb 07 19:50:31.628188 2017] [ssl:warn] [pid 17265:tid 140333802358656] AH01909: RSA certificate configured for 10.1.1.163:443 does NOT include an ID which matches the server name
[Tue Feb 07 19:50:31.649372 2017] [ssl:warn] [pid 17266:tid 140333802358656] AH01909: RSA certificate configured for 10.1.1.163:443 does NOT include an ID which matches the server name
[Tue Feb 07 19:50:31.649851 2017] [:warn] [pid 17266:tid 140333802358656] mod_wsgi: Compiled for Python/3.4.0.
[Tue Feb 07 19:50:31.649872 2017] [:warn] [pid 17266:tid 140333802358656] mod_wsgi: Runtime using Python/3.4.3.
[Tue Feb 07 19:50:31.651402 2017] [mpm_event:notice] [pid 17266:tid 140333802358656] AH00489: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f mod_wsgi/3.4 Python/3.4.3 configured -- resuming normal operations
[Tue Feb 07 19:50:31.651466 2017] [core:notice] [pid 17266:tid 140333802358656] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 07 19:50:33.728378 2017] [:error] [pid 17270:tid 140333668648704] /usr/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: The django.forms.util module has been renamed. Use django.forms.utils instead.
[Tue Feb 07 19:50:33.728432 2017] [:error] [pid 17270:tid 140333668648704]   return f(*args, **kwds)

我尝试过:删除.pyc文件,mod_wsgi更新。 Django迁移正在发挥作用。

1 个答案:

答案 0 :(得分:1)

解决方案是https://code.djangoproject.com/ticket/22948

我已将WSGIApplicationGroup %{GLOBAL}添加到a​​pache配置中。 仍然不确定为什么会出现这个问题