我使用Django 3.1.5创建了一个应用程序,但由于某些原因,它不能正确部署。我会分享我的所作所为,并拥有它。
我已经设置了我的Procfile和我的requirements.txt,我按照我在网站上所说的做了部署,但我仍然收到一个错误。
computer setting image and Procfile
在我的settings.py上,我有这个:
# on the top of the file
import django_heroku
# on the bottom of the file
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_DIRS = [
os.path.join(BASE_DIR, 'todo/static')
]
LOGIN_URL = '/login'
# Activate Django-Heroku.
django_heroku.settings(locals())
Procfile
web: gunicorn todowoo.wsgi
在我完成部署之后,我得到这个错误
应用程序错误应用程序中发生错误,无法提供您的页面。如果您是应用程序所有者,请查看您的日志以了解详细信息。heroku日志--tail获取详细信息
以下是详细信息:
2021-01-27T03:16:07.704192+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=djangotodowoo.herokuapp.com request_id=babd8359-3dfe-4df9-8ce6-5243de91b159 fwd="66.31.116.154" dyno=
connect= service= status=503 bytes= protocol=https
2021-01-27T03:16:07.912002+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=djangotodowoo.herokuapp.com request_id=4114d73f-f15f-4d35-9c1b-e25225a36bde fwd="66.31.116.154" dyno= connect= service= status=503 bytes= protocol=https
2021-01-27T03:16:10.630599+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=djangotodowoo.herokuapp.com request_id=9426a4a1-061f-41b6-a9a0-46190b752b60 fwd="66.31.116.154" dyno=
connect= service= status=503 bytes= protocol=https
2021-01-27T03:16:10.760576+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=djangotodowoo.herokuapp.com request_id=cb4c8412-eaa2-482a-9daa-e5126f2a89e3 fwd="66.31.116.154" dyno= connect= service= status=503 bytes= protocol=https
2021-01-27T03:16:11.398016+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=djangotodowoo.herokuapp.com request_id=8f025699-e7b8-4ca8-9795-36ad7754ef9f fwd="66.31.116.154" dyno=
connect= service= status=503 bytes= protocol=https
2021-01-27T03:16:11.548669+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=djangotodowoo.herokuapp.com request_id=d1c4ed4e-bbf6-43ff-88d0-2788f268fbe3 fwd="66.31.116.154" dyno= connect= service= status=503 bytes= protocol=https
2021-01-27T03:18:44.000000+00:00 app[api]: Build started by user lenilunderman@gmail.com
2021-01-27T03:19:12.176886+00:00 app[api]: Release v6 created by user lenilunderman@gmail.com
2021-01-27T03:19:12.176886+00:00 app[api]: Deploy 6caa0271 by user lenilunderman@gmail.com
2021-01-27T03:19:22.000000+00:00 app[api]: Build succeeded
我尝试运行heroku ps:scale web=1,得到的结果是:
Scaling dynos... !
! Couldn't find that process type (web).
你知道怎么解决这个问题吗?谢谢。
发布于 2021-01-27 12:08:26
我最近也遇到过类似的情况。我遵循以下命令成功地将django应用程序部署到heroku中
首先,确保您拥有requirements.txt
和Procfile
Procfile
中,内容类似于web: python manage.py runserver 0.0.0.0:$PORT
为了确保没有来自collectstatic
的错误,运行
python manage.py collectstatic
在cmd
中使用
然后,
登录
https://stackoverflow.com/questions/65912695
复制相似问题