0

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: What my webpage looks like

MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
12944qwerty
  • 2,001
  • 1
  • 10
  • 30
  • This question has the answer https://stackoverflow.com/questions/18552846/no-web-processes-running-django-in-heroku or you can manually scale using the heroku doc , check https://devcenter.heroku.com/articles/scaling – Bidhan Majhi Jul 27 '19 at 06:40
  • @BidhanMajhi When trying to scale using `heroku ps:scale web=1` I get an error saying that they couldn't find the `web` process type. `Procfile` includes `web: gunicorn prremia.wsgi` – 12944qwerty Jul 27 '19 at 06:47
  • Go to your heroku dashboard, then in dashboard go to resources and check, if you have dynos. – Bidhan Majhi Jul 27 '19 at 06:53
  • @BidhanMajhi It tells me that I haven't made a `Procfile` but as I said above, I do, and I made sure to push it onto heroku. – 12944qwerty Jul 27 '19 at 06:57
  • Change your Procfile to `web: gunicorn prremia.wsgi --log-file -` And make sure you commit it. – Bidhan Majhi Jul 27 '19 at 06:59
  • @BidhanMajhi Nope, heroku still doesn't see a Procfile – 12944qwerty Jul 27 '19 at 07:03
  • @BidhanMajhi So, I restarted the entire process of deploying to heroku and scaling worked. But now I get an error saying that the app has crashed – 12944qwerty Jul 27 '19 at 08:05

2 Answers2

1

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.

MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
0

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.

sahil
  • 11
  • 1