ImportError:在Django 1.10中导入wsgi文件时无法导入名称信号

2024-10-08 18:27:50 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试使用apache运行Django时遇到以下错误:

mod_wsgi (pid=3294): Target WSGI script '/www/cocurate2_dev/startup.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=3294): Exception occurred processing WSGI script '/www/cocurate2_dev/startup.wsgi'.
Traceback (most recent call last):
  File "/www/cocurate2_dev/startup.wsgi", line 3, in <module>
    from django.core.wsgi import get_wsgi_application
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/core/wsgi.py", line 2, in <module>
    from django.core.handlers.wsgi import WSGIHandler
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 10, in <module>
    from django import http
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/http/__init__.py", line 5, in <module>
    from django.http.response import (
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/http/response.py", line 13, in <module>
    from django.core.serializers.json import DjangoJSONEncoder
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/core/serializers/__init__.py", line 23, in <module>
    from django.core.serializers.base import SerializerDoesNotExist
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/core/serializers/base.py", line 4, in <module>
    from django.db import models
  File "/www/cocurate2_dev/components/lib/python2.7/site-packages/django/db/models/__init__.py", line 4, in <module>
    from django.db.models import signals  # NOQA
ImportError: cannot import name signals

使用时一切正常管理.py运行服务器。我已经将wsgi文件更新为与django1.10中的默认文件相同。 我查过了信号.py存在于django中,我还清理了.pyc文件。在


Tags: djangoinfrompycoredevimportwsgi
2条回答

事实证明,由于各种原因,django安装中确实缺少一个文件,但事实并非如此信号.py而是它进口的东西。 您可以通过使用-v或-vv开关运行python来调试类似的问题,使输出变得冗长。我可以看到它正试图从中导入另一个文件信号.py. 在

当我的django1.10安装被第三方降级到django1.6时,我遇到了这个错误。 在删除它并重新安装Django的正确版本之后,一切都像一个champ一样工作。在

相关问题 更多 >

    热门问题