简体   繁体   English

使用 django 到 heroku 部署网站应用程序时显示 Apliction 错误

[英]Displaying Apliction error while deploying website app using django to heroku

I created a movie review website using Python-Django I tried to make it live using Heroku but while opening there it is Showing Application Error in Heroku.我使用 Python-Django 创建了一个电影评论网站,我尝试使用 Heroku 使其生效,但是在打开时它在 Heroku 中显示应用程序错误。 My app runs fine locally.我的应用程序在本地运行良好。

Steps I followed to Install Heroku我遵循的安装 Heroku 的步骤

$sudo snap install --classic Heroku
$heroku login

And then run the following然后运行以下

$pipenv lock
$touch Procfile

Add the following line in wsgi file: " web:gunicorn pages_project.wsgi --log-file -"在 wsgi 文件中添加以下行:“ web:gunicorn pages_project.wsgi --log-file -”

$pipenv install gunicorn==19.9.0

Changes in the settings.py settings.py 中的更改

project/settings.py ALLOWED_HOSTS = ['*']项目/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

Here is my code on Github .这是我在 Github 上的代码。

Here is my Website link--> https://fast-island-20902.herokuapp.com/这是我的网站链接--> https://fast-island-20902.herokuapp.com/

Checking the Procfile on the Github repository:检查Procfile存储库上的 Procfile:

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

I see a typo on the project name which is actually movie_review .我在项目名称上看到一个错字,实际上是movie_review Just change it and the app should run in Heroku without issues.只需更改它,应用程序应该可以在 Heroku 中运行而不会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM