[Django]-How to overcome 'Coudn't find that formation' error when adding web dynos to Heroku django app?

13👍

Ensure that your Procfile has no extension.

To create a file with no extension on Windows, you can use the command notepad Procfile. from the command line.

19👍

To state the obvious: another way to encounter this issue is if you’re working on a new app, and you try running heroku ps:scale web=1 before you’ve actually done a git push heroku master. There is no Procfile on the Heroku server in that case, because there aren’t any files at all. 😀

12👍

To add yet another reason this can happen, my Procfile contained

web:gunicorn 

but it should be:

web: gunicorn

As far as I can tell from all of these answers, if you run into this problem, it is very likely related to Procfile.

👤Jason

7👍

for those interested, I had the same problem to add a worker. to do so you need to add this line to your procfile : worker: python worker.py

2👍

For others experiencing this same issue, make sure Procfile is not ignored in git.

Delete your Procfile. Then git status. If don’t see anything mentioning Procfile, you need to find remove the entry from local or global .gitignore.

1👍

I had the same problem because I missed git add and git commit the file named Procfile .

You should try to use the command git status and review whether the Procfile is included.

👤Jesse

1👍

I faced a similar issue while working on windows(haven’t tested on other operating systems)and this worked fine for me.

Initially, I have created a file name procfile and pushed it to heroku. But, heroku expects the Procfile declaration. It is case sensitive. Hence, we should be careful while typing the filename also.

Even after changing the name to Procfile git didnt notice changes(maybe git is case-insensitive just like windows). Hence, I had to delete the file completly and had to create a new one with Procfile as the name of the file.

1👍

When pushing to Heroku you must come up with something like shown in the Picture. If not your procfile has an Error.
enter image description here
The Procfile looks like this for my Flask app

web: gunicorn app:app

0👍

In my php project I can use

$ heroku ps:scale web=1

at the heroku directory “php-getting-started” (https://devcenter.heroku.com/articles/getting-started-with-php#prepare-the-app).

So I’m try to do this in my original application, so I tried to do again in Heroku Repository and it’s work.

(sorry about the english, hehe)

0👍

I got the same problme,

1) I also configured ProcFile
but the problem still available

So used this

Remove the existing buildpacks with heroku buildpacks:clear and add them again in the right order using the heroku buildpacks:add with the --index option, making sure that the language buildpack is the last in the list

git commit --allow-empty -m "Adjust buildpacks on Heroku"
git push heroku master

Problem solved

0👍

I had a similar problem and tried the following:

  • Made sure Procfile does not have any extension
  • Procfile is spelled exactly as ‘Procfile’

At the end of the day just realized that my Procfile was in my app directory. It should be on the root/project directory.

Leave a comment