我打算使用Heroku托管它。但这由于配置文件问题而无效。
这是我的Procfile
web: gunicorn onlineMenu.wsgi --log-file -
我的wsgi.py代码
"""
WSGI config for onlineMenu project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'onlineMenu.settings')
application = get_wsgi_application()
这是我的Heroku日志(不是全部)
2020-10-23T16:04:08.861587 + 00:00 app [web.1]:追溯(最新 最后调用):2020-10-23T16:04:08.861588 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py”, 583行,在spawn_worker 2020-10-23T16:04:08.861588 + 00:00 app [web.1]中: worker.init_process()2020-10-23T16:04:08.861589 + 00:00 app [web.1]: 文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py”, 第119行,在init_process 2020-10-23T16:04:08.861589 + 00:00 app [web.1]中: self.load_wsgi()2020-10-23T16:04:08.861589 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py”, 在load_wsgi 2020-10-23T16:04:08.861590 + 00:00 app [web.1]中的第144行: self.wsgi = self.app.wsgi()2020-10-23T16:04:08.861590 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py”, wsgi 2020-10-23T16:04:08.861590 + 00:00 app [web.1]中的第67行: self.callable = self.load()2020-10-23T16:04:08.861591 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, 第49行,正在加载2020-10-23T16:04:08.861591 + 00:00 app [web.1]:返回 self.load_wsgiapp()2020-10-23T16:04:08.861591 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py”, 第39行,在load_wsgiapp 2020-10-23T16:04:08.861592 + 00:00 app [web.1]中: 返回util.import_app(self.app_uri)2020-10-23T16:04:08.861592 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py”, 358行,位于import_app 2020-10-23T16:04:08.861592 + 00:00 app [web.1]中: mod = importlib.import_module(模块)2020-10-23T16:04:08.861593 + 00:00 app [web.1]:文件 “ /app/.heroku/python/lib/python3.8/importlib/init.py”,第127行, 在import_module 2020-10-23T16:04:08.861593 + 00:00 app [web.1]中:返回 _bootstrap._gcd_import(名称[级别:],程序包,级别)2020-10-23T16:04:08.861593 + 00:00 app [web.1]:文件“”,行1014,在_gcd_import中 2020-10-23T16:04:08.861594 + 00:00 app [web.1]:文件“”,第991行,位于_find_and_load中 2020-10-23T16:04:08.861594 + 00:00 app [web.1]:文件“”,第973行,处于_find_and_load_unlocked状态 2020-10-23T16:04:08.861594 + 00:00 app [web.1]:ModuleNotFoundError:否 名为'onlineMenu / wsgi'的模块2020-10-23T16:04:08.861841 + 00:00 app [web.1]:[2020-10-23 16:04:08 +0000] [10] [INFO]工人退出 (pid:10)2020-10-23T16:04:09.011977 + 00:00 app [web.1]:[2020-10-23 16:04:09 +0000] [4] [INFO]关机:大师 2020-10-23T16:04:09.012166 + 00:00 app [web.1]:[2020-10-23 16:04:09 +0000] [4] [INFO]原因:工作者无法启动。