【发布时间】:2017-07-26 06:52:08
【问题描述】:
我在尝试使用 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
使用 manage.py runserver 时一切正常。我已将 wsgi 文件更新为与 django 1.10 中的默认文件相同。 我检查了 django 中是否存在 signals.py,我还清理了 .pyc 文件。
【问题讨论】:
-
看看这是否有帮助! serverfault.com/questions/817729/…
-
谢谢,我看到了,但我没有在日志中看到任何关于不可读文件的错误。
标签: python django django-wsgi