0
heroku에 내 장고 웹 응용 프로그램을 배포하려고합니다. 열려고하면 응용 프로그램 오류 메시지가 나에게 나타납니다. 내가 로그에 발견작업자 프로세스의 예외 : wsgi 모듈이 없습니다.
2016-09-27T07:56:16.836350+00:00 heroku[web.1]: State changed from crashed to starting
2016-09-27T07:56:21.160909+00:00 heroku[web.1]: Starting process with command `gunicorn myblog.wsgi --log-file -`
2016-09-27T07:56:24.063399+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [3] [INFO] Listening at: http://0.0.0.0:37485 (3)
2016-09-27T07:56:24.062805+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [3] [INFO] Starting gunicorn 19.4.5
2016-09-27T07:56:24.063556+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [3] [INFO] Using worker: sync
2016-09-27T07:56:24.066328+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [9] [INFO] Booting worker with pid: 9
2016-09-27T07:56:24.069171+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [9] [ERROR] Exception in worker process:
2016-09-27T07:56:24.069172+00:00 app[web.1]: Traceback (most recent call last):
2016-09-27T07:56:24.069175+00:00 app[web.1]: worker.init_process()
2016-09-27T07:56:24.069175+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-09-27T07:56:24.069176+00:00 app[web.1]: self.load_wsgi()
2016-09-27T07:56:24.069174+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2016-09-27T07:56:24.069177+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2016-09-27T07:56:24.069178+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-09-27T07:56:24.069179+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-09-27T07:56:24.069179+00:00 app[web.1]: self.callable = self.load()
2016-09-27T07:56:24.069180+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-09-27T07:56:24.069181+00:00 app[web.1]: return self.load_wsgiapp()
2016-09-27T07:56:24.069181+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-09-27T07:56:24.069182+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-09-27T07:56:24.069183+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-09-27T07:56:24.069183+00:00 app[web.1]: __import__(module)
2016-09-27T07:56:24.069185+00:00 app[web.1]: Traceback (most recent call last):
2016-09-27T07:56:24.069185+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2016-09-27T07:56:24.069186+00:00 app[web.1]: worker.init_process()
2016-09-27T07:56:24.069184+00:00 app[web.1]: ImportError: No module named wsgi
2016-09-27T07:56:24.069186+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-09-27T07:56:24.069187+00:00 app[web.1]: self.load_wsgi()
2016-09-27T07:56:24.069188+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-09-27T07:56:24.069188+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2016-09-27T07:56:24.069189+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-09-27T07:56:24.069189+00:00 app[web.1]: self.callable = self.load()
2016-09-27T07:56:24.069190+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-09-27T07:56:24.069191+00:00 app[web.1]: return self.load_wsgiapp()
2016-09-27T07:56:24.069191+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-09-27T07:56:24.069192+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-09-27T07:56:24.069193+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-09-27T07:56:24.069193+00:00 app[web.1]: __import__(module)
2016-09-27T07:56:24.069194+00:00 app[web.1]: ImportError: No module named wsgi
2016-09-27T07:56:24.069351+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [9] [INFO] Worker exiting (pid: 9)
2016-09-27T07:56:24.088872+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [3] [INFO] Shutting down: Master
2016-09-27T07:56:24.089020+00:00 app[web.1]: [2016-09-27 07:56:24 +0000] [3] [INFO] Reason: Worker failed to boot.
2016-09-27T07:56:24.210605+00:00 heroku[web.1]: State changed from starting to crashed
2016-09-27T07:56:24.197593+00:00 heroku[web.1]: Process exited with status 3
오류는 다음과 같습니다 :
이
내 로그입니다- [ERROR] 작업자 프로세스에서 예외 :
- ImportError를 : 없음 모듈 이름 WSG
내 procfile : (내 앱은 myblog)
,363,210web: gunicorn myblog.wsgi --log-file -
requirements.txt가 :
Django==1.9.2
argparse==1.2.1
dj-database-url==0.4.0
dj-static==0.0.6
django-toolbelt==0.0.1
gunicorn==19.4.5
psycopg2==2.6.1
static3==0.7.0
whitenoise==2.0.6
wsgiref==0.1.2
참고 : 내가 사용 중지됨 Collectstatic이 명령을 사용하여
heroku config:set DISABLE_COLLECTSTATIC=1
편집 : ------------- --------------------------------------
내 wsgi.py 파일 :
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog.settings")
application = get_wsgi_application()
application = DjangoWhiteNoise(application)
내 프로젝트 구조 :
Django-Blog
/blog
settings.py
urls.py
wsgi.py
__init__.py
/myblog
manage.py
requirements.txt
procfile
runtime.txt
/venv
.gitignore 파일 :
# Byte-compiled/optimized/DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution/packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test/coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
myblog/static/myblog/images/
myblog/migrations/
.idea/workspace.xml
* * 당신이 WSGI 파일을 가지고 있습니까? 그것을 보여 주시고 전체 파일 구조를 보여주십시오. –
아니요 myblog.py라는 파일이 없습니다 – Salma
실제 구조입니까? '__init __. py' 파일이 없습니다. –