简体   繁体   中英

Django website deploying to heroku. Application error

I'm trying to deploy my django website to heroku but I get an Application Error shown on the webpage. Looking at my logs using heroku logs --tail (what it tells me to do on webpage), I recieve an error

2019-07-27T06:14:34.046386+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=prremia.herokuapp.com request_id=20cd473d-50c2-43b6-892e-ce8f8981229d fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https
2019-07-27T06:14:34.878053+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=prremia.herokuapp.com request_id=53c5e449-ba17-4e93-86f9-7b70eeb7e074 fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https

I followed the instructions from Django's docs .

  • Django 2.2.3
  • Python 3.7.3
  • Heroku-18

My webpage: 我的网页是什么样的

Make sure your put your Procfile at the root of project along with manage.py . Also make sure you pushed the code from your project root. Bind port dynamically in your Procfile . Here's an example:-

web: gunicorn --bind 0.0.0.0:$PORT prremia.wsgi

$PORT is an environment variable. You must do scaling too.

Note: Make sure your project name exactly matches with <project_name>.wsgi in your Procfile .

Some time silly mistake is there when some one create Procfile as text file so use the given command in your cmd to generate Prockfile:-

echo "web: python app.py" > Procfile

// I hope my answer help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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