2016-09-08 2 views
0

유감스럽게도 내 웹 사이트에서 500 오류가 발생했습니다.WSGI : 장고 앱이 필요한 사이트 패키지를받지 못했습니다.

아파치 로그는 실제로 구체적이지 않으므로 무엇을해야할지 모르겠습니다. 일부 apt-get 업그레이드 전에는 모든 것이 잘 작동했습니다.

권한 오류 일 수 있습니다. WSGI에서 작동하는 권한을 어떻게 설정해야합니까?

또는 다른 이유로이 문제가 발생할 수있는 이유를 알고 계십니까?

아파치의 conf :

... 
WSGIDaemonProcess aegee-stuttgart.org python-path=/home/sysadmin/public_html/aegee-stuttgart.org:/home/sysadmin/.virtualenvs/django/lib/python2.7 
    WSGIProcessGroup aegee-stuttgart.org 
    WSGIScriptAlias//home/sysadmin/public_html/aegee-stuttgart.org/aegee/wsgi.py 
... 

wsgi.py :

... 
import os, sys 

# add the aegee project path into the sys.path 
sys.path.append('/home/sysadmin/public_html/aegee-stuttgart.org/aegee') 

# add the virtualenv site-packages path to the sys.path 
sys.path.append('/home/sysadmin/.virtualenvs/django/lib/python2.7/site-packages') 
import django 
from django.core.handlers.wsgi import WSGIHandler 
... 

하는 error.log :

mod_wsgi (pid=23202): Exception occurred processing WSGI script '/home/sysadmin/p$ 
Traceback (most recent call last): 
File "/home/sysadmin/public_html/aegee-stuttgart.org/aegee/wsgi.py", line 31, i$ 
    return super(WSGIEnvironment, self).__call__(environ, start_response) 
File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 189,$ 
    response = self.get_response(request) 
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 218,$ 
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) 
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 264,$ 
    if resolver.urlconf_module is None: 
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 395, $ 
    self._urlconf_module = import_module(self.urlconf_name) 
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
File "/home/sysadmin/public_html/aegee-stuttgart.org/aegee/urls.py", line 8, in$ 
    from .userprofile.views import AccountPersonalInfoView 
File "/home/sysadmin/public_html/aegee-stuttgart.org/aegee/userprofile/views.py$ 
    from django.contrib.auth.mixins import LoginRequiredMixin 
ImportError: No module named mixins 
+0

마지막 줄에'django.contrib.auth.mixins에서 가져 오기 LoginRequiredMixin - ImportError : 모듈에 mixins'이 없습니다. 장고 1.9.x 이상을 실행하고 있습니까? – C14L

+0

나는 virtualenv에서 1.9.9 장고를 실행하고 있지만 분명히 wsgi는 그것을 인식하지 못한다 ... 나는 이것을 고치는 방법에 대한 단서가 없다. – setchock

+0

이전 버전의 장고 모듈이 사용되고있는 것처럼 보인다. 'sys.path'. 아마도'wsgi.py'에서 virtualenv site-packages 디렉토리를 끝에 추가하는 대신 _first_ 항목으로 삽입 해보십시오. –

답변

1

사용 :

WSGIDaemonProcess aegee-stuttgart.org python-home=/home/sysadmin/.virtualenvs/django python-path=/home/sysadmin/public_html/aegee-stuttgart.org 
,

당신이 가진 것이 아닙니다. python-path을 사용하여 가상 환경을 참조 할 수 있지만 잘못된 디렉토리를 사용하고있었습니다. 대신 python-home을 사용하고 가상 환경의 경우 sys.prefix과 동일한 디렉토리로 설정하십시오.

잘못된 디렉토리를 사용했기 때문에 가상 환경이 아닌 기본 Python 설치에서 Django를 선택했습니다.

관련 문제