git push django中的heroku master工作正常,但应用程序在Django中崩溃了

问题描述

The whole project is available in this drive link 当我在本地主机上执行该项目时,该项目运行良好 尝试在heroku上进行部署时,我的应用程序崩溃了,当我运行(heroku日志-尾巴)时,显示以下错误消息,如下所示。

(请注意,我没有更改秘密密钥,因为我觉得在项目的当前状态中这并不重要,因为这仅出于教育/发展目的,请考虑一下)。请帮忙!

我已经收到与已经提出的问题类似的问题。但是PIL以Pillow == 7.2.0的形式存在于requirements.txt文件中 在相同的问题上还有更多的答案,我尝试了很多,但对我没有帮助

2020-08-10T17:58:57.717239+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [10]
 [ERROR] Exception in worker process    
    2020-08-10T17:58:57.717284+00:00 app[web.1]: Traceback (most recent call last):    
    2020-08-10T17:58:57.717286+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py",line 583,in spawn_worker    
    2020-08-10T17:58:57.717288+00:00 app[web.1]: worker.init_process()    
    2020-08-10T17:58:57.717288+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py",line 119,in init_process    
    2020-08-10T17:58:57.717288+00:00 app[web.1]: self.load_wsgi()
    2020-08-10T17:58:57.717289+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py",line 144,in load_wsgi
    2020-08-10T17:58:57.717289+00:00 app[web.1]: self.wsgi = self.app.wsgi()    
    2020-08-10T17:58:57.717291+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py",line 67,in wsgi    
    2020-08-10T17:58:57.717291+00:00 app[web.1]: self.callable = self.load()    
    2020-08-10T17:58:57.717291+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py",line 49,in load        
    2020-08-10T17:58:57.717291+00:00 app[web.1]: return self.load_wsgiapp()    
    2020-08-10T17:58:57.717292+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py",line 39,in load_wsgiapp    
    2020-08-10T17:58:57.717292+00:00 app[web.1]: return util.import_app(self.app_uri)    
    2020-08-10T17:58:57.717292+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py",line 358,in import_app    
    2020-08-10T17:58:57.717292+00:00 app[web.1]: mod = importlib.import_module(module)    
    2020-08-10T17:58:57.717292+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py",line 127,in import_module
    2020-08-10T17:58:57.717294+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:],package,level)    
    2020-08-10T17:58:57.717294+00:00 app[web.1]: File "<frozen importlib._bootstrap>",line 1006,in _gcd_import    
    2020-08-10T17:58:57.717294+00:00 app[web.1]: File "<frozen importlib._bootstrap>",line 983,in _find_and_load    
    2020-08-10T17:58:57.717295+00:00 app[web.1]: File "<frozen importlib._bootstrap>",line 967,in _find_and_load_unlocked    
    2020-08-10T17:58:57.717295+00:00 app[web.1]: File "<frozen importlib._bootstrap>",line 677,in _load_unlocked
    2020-08-10T17:58:57.717295+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>",line 728,in exec_module    
    2020-08-10T17:58:57.717295+00:00 app[web.1]: File "<frozen importlib._bootstrap>",line 219,in _call_with_frames_removed    
    2020-08-10T17:58:57.717295+00:00 app[web.1]: File "/app/Insta/wsgi.py",line 16,in <module>
    2020-08-10T17:58:57.717295+00:00 app[web.1]: application = get_wsgi_application()    
    2020-08-10T17:58:57.717296+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/wsgi.py",line 12,in get_wsgi_application
    2020-08-10T17:58:57.717296+00:00 app[web.1]: django.setup(set_prefix=False)
    2020-08-10T17:58:57.717296+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/__init__.py",line 24,in setup
    2020-08-10T17:58:57.717296+00:00 app[web.1]: apps.populate(settings.INSTALLED_APPS)    
    2020-08-10T17:58:57.717296+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/apps/registry.py",line 114,in populate    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: app_config.import_models()    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/apps/config.py",line 211,in import_models    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: self.models_module = import_module(models_module_name)    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py",in import_module    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:],level)    
    2020-08-10T17:58:57.717297+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _gcd_import    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load_unlocked    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _load_unlocked    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>",in exec_module    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _call_with_frames_removed    
    2020-08-10T17:58:57.717298+00:00 app[web.1]: File "/app/angram/models.py",line 3,in <module>    
    2020-08-10T17:58:57.717299+00:00 app[web.1]: from PIL import Image    
    2020-08-10T17:58:57.717299+00:00 app[web.1]: ModuleNotFoundError: No module named 'PIL'    
    2020-08-10T17:58:57.717545+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [10] [INFO] Worker exiting (pid: 10)    
    2020-08-10T17:58:57.731434+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [11] [ERROR] Exception in worker process    
    2020-08-10T17:58:57.731436+00:00 app[web.1]: Traceback (most recent call last):    
    2020-08-10T17:58:57.731437+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py",in spawn_worker    
    2020-08-10T17:58:57.731438+00:00 app[web.1]: worker.init_process()    
    2020-08-10T17:58:57.731438+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py",in init_process    
    2020-08-10T17:58:57.731439+00:00 app[web.1]: self.load_wsgi()
    2020-08-10T17:58:57.731439+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py",in load_wsgi    
    2020-08-10T17:58:57.731439+00:00 app[web.1]: self.wsgi = self.app.wsgi()    
    2020-08-10T17:58:57.731440+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py",in wsgi    
    2020-08-10T17:58:57.731440+00:00 app[web.1]: self.callable = self.load()    
    2020-08-10T17:58:57.731441+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py",in load    
    2020-08-10T17:58:57.731441+00:00 app[web.1]: return self.load_wsgiapp()    
    2020-08-10T17:58:57.731441+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py",in load_wsgiapp    
    2020-08-10T17:58:57.731442+00:00 app[web.1]: return util.import_app(self.app_uri)    
    2020-08-10T17:58:57.731448+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py",in import_app
    2020-08-10T17:58:57.731449+00:00 app[web.1]: mod = importlib.import_module(module)    
    2020-08-10T17:58:57.731449+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py",in import_module    
    2020-08-10T17:58:57.731450+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:],level)    
    2020-08-10T17:58:57.731450+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _gcd_import    
    2020-08-10T17:58:57.731451+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load    
    2020-08-10T17:58:57.731451+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load_unlocked    
    2020-08-10T17:58:57.731452+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _load_unlocked    
    2020-08-10T17:58:57.731452+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>",in exec_module    
    2020-08-10T17:58:57.731452+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _call_with_frames_removed    
    2020-08-10T17:58:57.731453+00:00 app[web.1]: File "/app/Insta/wsgi.py",in <module>    
    2020-08-10T17:58:57.731453+00:00 app[web.1]: application = get_wsgi_application()    
    2020-08-10T17:58:57.731454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/wsgi.py",in get_wsgi_application    
    2020-08-10T17:58:57.731454+00:00 app[web.1]: django.setup(set_prefix=False)    
    2020-08-10T17:58:57.731454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/__init__.py",in setup    
    2020-08-10T17:58:57.731454+00:00 app[web.1]: apps.populate(settings.INSTALLED_APPS)    
    2020-08-10T17:58:57.731455+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/apps/registry.py",in populate    
    2020-08-10T17:58:57.731455+00:00 app[web.1]: app_config.import_models()    
    2020-08-10T17:58:57.731455+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/django/apps/config.py",in import_models    
    2020-08-10T17:58:57.731456+00:00 app[web.1]: self.models_module = import_module(models_module_name)    
    2020-08-10T17:58:57.731456+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py",in import_module    
    2020-08-10T17:58:57.731456+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:],level)    
    2020-08-10T17:58:57.731457+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _gcd_import    
    2020-08-10T17:58:57.731457+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load    
    2020-08-10T17:58:57.731457+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _find_and_load_unlocked    
    2020-08-10T17:58:57.731457+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _load_unlocked    
    2020-08-10T17:58:57.731462+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>",in exec_module    
    2020-08-10T17:58:57.731462+00:00 app[web.1]: File "<frozen importlib._bootstrap>",in _call_with_frames_removed    
    2020-08-10T17:58:57.731463+00:00 app[web.1]: File "/app/angram/models.py",in <module>    
    2020-08-10T17:58:57.731463+00:00 app[web.1]: from PIL import Image    
    2020-08-10T17:58:57.731463+00:00 app[web.1]: ModuleNotFoundError: No module named 'PIL'
    2020-08-10T17:58:57.731730+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [11] [INFO] Worker exiting (pid: 11)    
    2020-08-10T17:58:57.951050+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [4] [INFO] Shutting down: Master    
    2020-08-10T17:58:57.951171+00:00 app[web.1]: [2020-08-10 17:58:57 +0000] [4] [INFO] Reason: Worker Failed to boot.    
    2020-08-10T17:58:58.069837+00:00 heroku[web.1]: Process exited with status 3    
    2020-08-10T17:58:58.110789+00:00 heroku[web.1]: State changed from up to crashed    
    2020-08-10T17:59:03.486724+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=anuraginstaclone.herokuapp.com request_id=faa21159-9450-4bc9-82e4-68930207196a fwd="60.243.148.124" dyno=web.1 connect=5000ms service= status=503 bytes= protocol=https    
    2020-08-10T17:59:03.816920+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=anuraginstaclone.herokuapp.com request_id=9ae26860-abd6-4944-82a3-397069c8b532 fwd="60.243.148.124" dyno= connect= service= status=503 bytes= protocol=https    
    2020-08-10T17:59:21.706244+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=anuraginstaclone.herokuapp.com request_id=a5412cbc-48e5-4ec9-b755-f70286ac3e48 fwd="60.243.148.124" dyno= connect= service= status=503 bytes= protocol=https    
    2020-08-10T17:59:22.043910+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=anuraginstaclone.herokuapp.com request_id=37a20a82-b237-4f75-9b9d-4eda8b4b338f fwd="60.243.148.124" dyno= connect= service= status=503 bytes= protocol=https**

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)