pythondjangoherokudeploymentdjango-wsgi

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.

My webpage: What my webpage looks like


Solution

  • 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.