现在我正在尝试将项目上传到Heroku云上,并且网站已经成功上传,但是当我尝试进入我创建的文件所在的页面时,我从heroku收到了应用程序错误页面:
我做了heroku所需的一切,所以这里发生了什么?
procfile
web: gunicorn website.wsgi
请告诉我如何解决该错误并获取响应页面!
编辑帖子:
2020-08-09T11:44:17.624839+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-09T11:44:25.491114+00:00 heroku[web.1]: Starting process with command `gunicorn website.wsgi`
2020-08-09T11:44:28.774370+00:00 app[web.1]: [2020-08-09 11:44:28 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-08-09T11:44:28.774934+00:00 app[web.1]: [2020-08-09 11:44:28 +0000] [4] [INFO] Listening at: http://0.0.0.0:24097 (4)
2020-08-09T11:44:28.775043+00:00 app[web.1]: [2020-08-09 11:44:28 +0000] [4] [INFO] Using worker: sync
2020-08-09T11:44:28.778601+00:00 app[web.1]: [2020-08-09 11:44:28 +0000] [9] [INFO] Booting worker with pid: 9
2020-08-09T11:44:28.835957+00:00 app[web.1]: [2020-08-09 11:44:28 +0000] [10] [INFO] Booting worker with pid: 10
2020-08-09T11:44:29.915918+00:00 app[web.1]: [2020-08-09 11:44:29 +0000] [10] [ERROR] Exception in worker process
2020-08-09T11:44:29.915974+00:00 app[web.1]: Traceback (most recent call last):
2020-08-09T11:44:29.915976+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-08-09T11:44:29.915976+00:00 app[web.1]: worker.init_process()
2020-08-09T11:44:29.915977+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
2020-08-09T11:44:29.915977+00:00 app[web.1]: self.load_wsgi()
2020-08-09T11:44:29.915977+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2020-08-09T11:44:29.915978+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-08-09T11:44:29.915978+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-08-09T11:44:29.915978+00:00 app[web.1]: self.callable = self.load()
2020-08-09T11:44:29.915979+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2020-08-09T11:44:29.915979+00:00 app[web.1]: return self.load_wsgiapp()
2020-08-09T11:44:29.915979+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2020-08-09T11:44:29.915980+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-08-09T11:44:29.915980+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2020-08-09T11:44:29.915980+00:00 app[web.1]: mod = importlib.import_module(module)
2020-08-09T11:44:29.915981+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2020-08-09T11:44:29.915982+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-08-09T11:44:29.915982+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2020-08-09T11:44:29.915982+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2020-08-09T11:44:29.915983+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
2020-08-09T11:44:29.915983+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
2020-08-09T11:44:29.915983+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 783, in exec_module
2020-08-09T11:44:29.915984+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-08-09T11:44:29.915984+00:00 app[web.1]: File "/app/website/wsgi.py", line 16, in <module>
2020-08-09T11:44:29.915984+00:00 app[web.1]: application = get_wsgi_application()
2020-08-09T11:44:29.915985+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-08-09T11:44:29.915985+00:00 app[web.1]: django.setup(set_prefix=False)
2020-08-09T11:44:29.915985+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
2020-08-09T11:44:29.915986+00:00 app[web.1]: apps.populate(settings.INSTALLED_APPS)
2020-08-09T11:44:29.915986+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
2020-08-09T11:44:29.915986+00:00 app[web.1]: app_config = AppConfig.create(entry)
2020-08-09T11:44:29.915987+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/config.py", line 90, in create
2020-08-09T11:44:29.915987+00:00 app[web.1]: module = import_module(entry)
2020-08-09T11:44:29.915987+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2020-08-09T11:44:29.915988+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-08-09T11:44:29.915988+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2020-08-09T11:44:29.915988+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2020-08-09T11:44:29.915989+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2020-08-09T11:44:29.915989+00:00 app[web.1]: ModuleNotFoundError: No module named 'allauth'
2020-08-09T11:44:29.916079+00:00 app[web.1]: [2020-08-09 11:44:29 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-08-09T11:44:29.917005+00:00 app[web.1]: [2020-08-09 11:44:29 +0000] [9] [ERROR] Exception in worker process
2020-08-09T11:44:29.917006+00:00 app[web.1]: Traceback (most recent call last):
2020-08-09T11:44:29.917007+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-08-09T11:44:29.917007+00:00 app[web.1]: worker.init_process()
2020-08-09T11:44:29.917008+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
2020-08-09T11:44:29.917008+00:00 app[web.1]: self.load_wsgi()
2020-08-09T11:44:29.917008+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2020-08-09T11:44:29.917009+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-08-09T11:44:29.917009+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-08-09T11:44:29.917009+00:00 app[web.1]: self.callable = self.load()
2020-08-09T11:44:29.917010+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2020-08-09T11:44:29.917010+00:00 app[web.1]: return self.load_wsgiapp()
2020-08-09T11:44:29.917010+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2020-08-09T11:44:29.917011+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-08-09T11:44:29.917017+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2020-08-09T11:44:29.917017+00:00 app[web.1]: mod = importlib.import_module(module)
2020-08-09T11:44:29.917018+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2020-08-09T11:44:29.917018+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-08-09T11:44:29.917018+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2020-08-09T11:44:29.917019+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2020-08-09T11:44:29.917019+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
2020-08-09T11:44:29.917020+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
2020-08-09T11:44:29.917020+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 783, in exec_module
2020-08-09T11:44:29.917020+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-08-09T11:44:29.917021+00:00 app[web.1]: File "/app/website/wsgi.py", line 16, in <module>
2020-08-09T11:44:29.917021+00:00 app[web.1]: application = get_wsgi_application()
2020-08-09T11:44:29.917021+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-08-09T11:44:29.917021+00:00 app[web.1]: django.setup(set_prefix=False)
2020-08-09T11:44:29.917022+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
2020-08-09T11:44:29.917022+00:00 app[web.1]: apps.populate(settings.INSTALLED_APPS)
2020-08-09T11:44:29.917022+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
2020-08-09T11:44:29.917023+00:00 app[web.1]: app_config = AppConfig.create(entry)
2020-08-09T11:44:29.917023+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/apps/config.py", line 90, in create
2020-08-09T11:44:29.917023+00:00 app[web.1]: module = import_module(entry)
2020-08-09T11:44:29.917024+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2020-08-09T11:44:29.917024+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-08-09T11:44:29.917024+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2020-08-09T11:44:29.917025+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2020-08-09T11:44:29.917025+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2020-08-09T11:44:29.917026+00:00 app[web.1]: ModuleNotFoundError: No module named 'allauth'
2020-08-09T11:44:29.917231+00:00 app[web.1]: [2020-08-09 11:44:29 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-08-09T11:44:30.090768+00:00 app[web.1]: [2020-08-09 11:44:30 +0000] [4] [INFO] Shutting down: Master
2020-08-09T11:44:30.090842+00:00 app[web.1]: [2020-08-09 11:44:30 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-08-09T11:44:30.159057+00:00 heroku[web.1]: Process exited with status 3
2020-08-09T11:44:30.200613+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-09T11:44:37.183618+00:00 heroku[run.2557]: Client connection closed. Sending SIGHUP to all processes
2020-08-09T11:44:37.709576+00:00 heroku[run.2557]: Process exited with status 129
2020-08-09T11:44:37.749575+00:00 heroku[run.2557]: State changed from up to complete
2020-08-09T11:45:33.686015+00:00 app[api]: Starting process with command `bash` by user medoabdin@gmail.com
2020-08-09T11:45:45.469923+00:00 heroku[run.5007]: State changed from starting to up
2020-08-09T11:45:45.751097+00:00 heroku[run.5007]: Awaiting client
2020-08-09T11:45:45.811639+00:00 heroku[run.5007]: Starting process with command `bash`
答案 0 :(得分:0)
Procfile
格式应为:
web: gunicorn ProjectName.wsgi:application --log-file -
确保已将您的应用程序添加到已安装的settings.py
如果您使用的是django-allauth
,请确保已将其添加到requirements.txt