Django部署-无web进程
我使用Django 3.1.5创建了一个应用程序,由于某些原因,它无法正确部署。我将分享我所做的并拥有它 我已经建立了我的Procfile,我有我的requirements.txt,我按照我在网站上说的做了部署,但是我仍然得到一个错误 在my settings.py上,我有以下内容:Django部署-无web进程,django,heroku,deployment,heroku-cli,django-deployment,Django,Heroku,Deployment,Heroku Cli,Django Deployment,我使用Django 3.1.5创建了一个应用程序,由于某些原因,它无法正确部署。我将分享我所做的并拥有它 我已经建立了我的Procfile,我有我的requirements.txt,我按照我在网站上说的做了部署,但是我仍然得到一个错误 在my settings.py上,我有以下内容: # on the top of the file import django_heroku # on the bottom of the file STATIC_URL = '/static/' STATIC
# 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())
程序文件
web:gunicorntodowoo.wsgi
完成部署后,我会收到此错误
应用程序错误
应用程序中出现错误,无法提供您的页面。如果您是应用程序所有者,请查看日志以了解详细信息。heroku日志--详细信息请参见尾部
详情如下:
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).
你知道怎么解决这个问题吗?谢谢。最近我遇到了类似的情况。我按照这些命令成功地将django应用程序部署到heroku中
- 首先确保您有
和requirements.txt
Procfile
- 在
中,内容如下Procfile
web:python manage.py运行服务器0.0.0.0:$PORT
- 然后运行
以确保没有来自python manage.py collectstatic
collectstatic的错误
- 然后在
cmd
- heroku登录
- 然后从浏览器登录
- git初始化
- heroku git:remote-应用程序名称
- git添加
- git提交-am“第一次提交”
- 吉特推希罗库主站
- heroku运行python manage.py迁移
- 赫罗库公开赛
Procfile
的位置,我注意到django的管理员在本地工作,但不是远程工作。我必须在本地创建一个新的管理员并再次推送代码吗?我可以在线创建用户,但管理员目前不存在。知道可能是什么吗?我已经解决了这个问题,我只需要在heroku上创建一个新的超级用户heroku运行python manage.py createsuperuser