1

I'm trying to deploy my django project at heroku, but it keep saying the error like below. error

According to that error, I did heroku logs --tail, and the error was like this.

2020-12-28T03:44:38.472162+00:00 heroku[router]: at=error code=H14 desc="No web processes running"
 method=GET path="/favicon.ico" host=nbnb-clone.herokuapp.com request_id=1e862587-ebc8-4dbb-85be-
12487ff9ae16 fwd="1.250.241.55" dyno= connect= service= status=503 bytes= protocol=https

I've tried heroku ps:scale web=1, and the return was like below.

Scaling dynos... !
 !    Couldn't find that process type (web).

Currently I'm using github as my deployment method in heroku. I've tried heroku buildpacks:clear and heroku buildpacks:add heroku/python, but it didn't work for me. Also I've tried git git push heroku main, return was like below.

error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/nbnb-clone.git'

My Procfile is like this

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

My requirements.txt

certifi==2020.12.5
chardet==4.0.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
django-countries==7.0
django-dotenv==1.4.2
django-seed==0.2.2
django==2.2.5
faker==5.0.2 ; python_version >= '3.6'
idna==2.10 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pillow==8.0.1
python-dateutil==2.8.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
pytz==2020.5
requests==2.25.1
six==1.15.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
sqlparse==0.4.1 ; python_version >= '3.5'
text-unidecode==1.3
urllib3==1.26.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'
psycopg2==2.8.4
gunicorn==20.0.4
django-heroku==0.3.1
whitenoise==5.2.0

What should I do to fix it?

Joseph Hwang
  • 324
  • 5
  • 13
  • Is the wsgi.py file in your project placed in config folder? – Ajay Lingayat Dec 28 '20 at 04:26
  • Thanks for your comment!!.And yes, that is placed in config folder – Joseph Hwang Dec 28 '20 at 04:41
  • If `git push heroku main` is not working you can list all the branches by running `git branch -a` and check what branch is it for heroku remote and push to that branch. – Ajay Lingayat Dec 28 '20 at 05:01
  • Oh, thanks so much! Your help fixed the error above! But I got another error which is "app crashed" XD. I needa go again to figure it out why :) – Joseph Hwang Dec 28 '20 at 05:23
  • You can delete the app and then again deploy it. And if you have some data stored into the deployed database then you can use `python manage.py dumpdata > seed.json` to save it into a json file and then when you deploy it again use data as initial data for your app. – Ajay Lingayat Dec 28 '20 at 05:25
  • Thanks for your help! Thanks to your help, I think I fixed all of the error. Now, my django project is successfully deployed to heroku and it doesn't give me that application error! – Joseph Hwang Dec 28 '20 at 12:20
  • how did you solve the error? – Vishal Pandey Dec 28 '20 at 12:51
  • In my case, during deploying my project to heroku with `git push heroku master`, I found that heroku was not able to recognize the "Procfile". As I searched for this, I found that I need to properly case the Procfile, capitalizing P. But it seemed that git commit is not working at the casing of filename, I deleted former Procfile, committed to git and pushed to heroku master. And I created new Procfile which is properly cased. After that, I commited and pushed again. And it worked! – Joseph Hwang Dec 28 '20 at 14:11
  • I suggest you to check out this.https://stackoverflow.com/questions/57137724/how-to-fix-miscased-procfile-in-heroku I really hope the above works for you. – Joseph Hwang Dec 28 '20 at 14:13

0 Answers0