django는apache2.4 python3.5(검증) 또는 3.x(미검증) 버전에 오류가 발생했습니다.

우선 감사합니다: @Graham Dumpleton 질문 링크:github 하루 시간.구글은 여러 가지 문제를 해결할 수 없습니다.아무리 찢어도 못 타.. 콜록콜록 위치/var/log/apache2/error.log 출현
[Mon Jul 25 20:10:41.247841 2016] [wsgi:error] [pid 18106] mod_wsgi (pid=18106): Call to 'site.addsitedir()' failed for '(null)', stopping.
[Mon Jul 25 20:10:41.247874 2016] [wsgi:error] [pid 18106] mod_wsgi (pid=18106): Call to 'site.addsitedir()' failed for '/home/ling/django_project/lib/python3.5/site-packages'.
[Mon Jul 25 20:10:47.198769 2016] [wsgi:error] [pid 18106] mod_wsgi (pid=18106): Call to 'site.addsitedir()' failed for '(null)', stopping.
[Mon Jul 25 20:10:47.198806 2016] [wsgi:error] [pid 18106] mod_wsgi (pid=18106): Call to 'site.addsitedir()' failed for '/home/ling/django_project/lib/python3.5/site-packages'.
[Mon Jul 25 20:10:47.444672 2016] [wsgi:error] [pid 18106] [remote 192.168.1.2:52125] mod_wsgi (pid=18106): Target WSGI script '/home/ling/django_project/project/simple_project/simple_project/wsgi.py' cannot be loaded as Python module.
[Mon Jul 25 20:10:47.444717 2016] [wsgi:error] [pid 18106] [remote 192.168.1.2:52125] mod_wsgi (pid=18106): Exception occurred processing WSGI script '/home/ling/django_project/project/simple_project/simple_project/wsgi.py'.
。。。    。。。           

The reference to debugging logging code was related to me commenting out logging code in mod_wsgi itself to verify where the issue was coming from, not disabling logging of your own.
Do be aware that any mod_wsgi packages shipped by Debian and Ubuntu are unsupported by Debian or Ubuntu and neither do I support them as they ship out of date ancient versions which are many releases behind. It is basically a myth that in a LTS version of those Linux distributions that they provide support. They don’t, they only do that for certain core packages and not the majority of stuff you might install. If you always use only system provided packages in the belief that they are supported, then the reality is that they aren’t.
As to a workaround, it depends on what paths you are trying to add. If you had something like:
WSGIDaemonProcess [...] python-path=/home/srittau/.virtualenvs/foo/lib/python3.5/site-packages:/home/srittau/foo/bar/pylibs

where one path is that related to a virtual environment, it isn’t the preferred way anyway. For a virtual environment you should use python-home option to specify the root of the virtual environment and not use python-path to specify the site-packages directory. Thus should use:
WSGIDaemonProcess [...] python-home=/home/srittau/.virtualenvs/foo python-path=/home/srittau/foo/bar/pylbs

Thus if the reason for two paths was because of one being the virtual environment, change it to the preferred setup and you should be good. If you are adding multiple directories for other reasons, this will not help and the only other option is to add the paths as part of the WSGI script file
총결산
사실 오류가 발생한 원인은python-path 경로를 사용하여 가상 환경을 지정할 수 없기 때문이다.python-home 경로를 사용해야 합니다. 그렇지 않으면 가상 환경을 통해python 응용 프로그램을 불러올 수 없습니다.
내 구성을 참조로 첨부합니다(내부 네트워크 구성 - 192.168.1.2를 도메인 이름으로 변경).

    ServerName 192.168.1.2
    ServerAdmin [email protected]

    Alias /media/ /home/ling/django_project/project/simple_project/media/
    Alias /static/ /home/ling/django_project/project/simple_project/blog/static/

    
        Require all granted
    

    
        Require all granted
    

    WSGIScriptAlias / /home/ling/django_project/project/simple_project/simple_project/wsgi.py
    WSGIDaemonProcess 192.168.1.2 python-path=/home/ling/django_project/project/simple_project python-home=/home/ling/django_project/lib/python3.5/site-packages
    WSGIProcessGroup 192.168.1.2

    
    
        Require all granted
    
    

좋은 웹페이지 즐겨찾기