nginx + uwsgi를 사용하여 장고 응용 프로그램을 배포하려고합니다. 가상 환경 (virtualenv)을 생성하고, 가상 환경 (즉, 가상 환경에 국한) 내에 uwsgi와 Django를 모두 설치했습니다. 나는 장고와 uwsgi가 없다. 예외 : 나는 uwsgi --ini project.ini, 나는 데에 '아니오 모듈 이름 django.core.wsgi ImportError를을'실행하면uwsgi + nginx + Django : ImportError : django.core.wsgi라는 모듈이 없습니다.
내 검색을 바탕으로from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 5987)
spawned uWSGI worker 1 (pid: 5988, cores: 1)
spawned uWSGI worker 2 (pid: 5989, cores: 1)
spawned uWSGI worker 3 (pid: 5990, cores: 1)
spawned uWSGI worker 4 (pid: 5991, cores: 1)
, ENV와 PYTHONPATH 변수를 넣어 권장 ini에서는 Django1.5 이하를 사용하고 있습니다. 그러나 장고 1.7을 사용하고 있으므로 더 이상 배치하지 않았습니다. 내 프로젝트는 다음과 같습니다.
#project.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /root/virtualenv/project
# Django wsgi file
module = project.wsgi:application
# the virtualenv (full path)
home = /root/virtualenv
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 4
# the socket (use the full path to be safe
socket = /root/virtualenv/project/project.sock
# ... with appropriate permissions - may be needed
chmod-socket = 666
chown-socket = root:root
# clear environment on exit
vacuum = true
# other config options
uid = root
gid = root
processes = 4
daemonize = /var/log/uwsgi/project.log
no-site = True
어떻게 수정합니까? 나는 이미 하루 동안 이걸 붙잡고있다. 모든 아이디어는 대단히 감사하겠습니다. 미리 감사드립니다.
하지만 어떻게 uwsgi를 실행하고 있습니까? virtualenv를 실행하기 전에 활성화해야합니다. –
그건 내 질문이다. uwsgi 실행 방법 ... 가상 환경을 활성화 한 다음 uwsgi를 실행했습니다. 그러나 언급 한 바와 같이 위의 오류가 – jaysonpryde
인데 오류가 발생했을 때 어떻게 했습니까? 입력 한 명령의 정확한 순서를 보여주십시오. –