使用Django将网站应用程序部署到Heroku时显示Apliction错误

时间:2019-10-28 10:20:17

标签: python django heroku

我使用Python-Django创建了一个电影评论网站,我试图使用Heroku使其上线,但是在打开该网站时,它在Heroku中显示Application Error。我的应用程序在本地运行良好。

我按照步骤安装Heroku

$sudo snap install --classic Heroku
$heroku login

然后运行以下

$pipenv lock
$touch Procfile

在wsgi文件中添加以下行:     网站:gunicorn pages_project.wsgi --log文件-“

$pipenv install gunicorn==19.9.0

更改settings.py

project / settings.py ALLOWED_HOSTS = ['*']

$heroku create
$heroku git:remote -a xxx-yyy-26076
$heroku config:set DISABLE_COLLECTSTATIC=1
$git push heroku master
$heroku ps:scale web=1
$heroku open

这是我的代码on Github

这是我的网站链接-> https://fast-island-20902.herokuapp.com/

1 个答案:

答案 0 :(得分:0)

在Github存储库中检查Procfile

web: gunicorn movie_reveiw.wsgi --log-file -

我在项目名称上看到一个错字,实际上是movie_review。只需对其进行更改,该应用程序即可在Heroku中正常运行。