[Fixed]-Git push heroku master: Heroku push rejected, no Cedar-supported app detected

33👍

Just had this problem too. I did the following to solve it: (assuming you’re in project dir)

rm -rf .git
git init 
git add .
git commit -m "First commit"
heroku create --stack cedar
git push heroku master

A slightly involved solution to create a new application, but at least it works. Hope that helps!

13👍

You probably need to add a requirements.txt file. check the python app docs

👤Udi

8👍

I had a similar issue and in my case was because my apps were outside of my project folder. Heroku expects to have this structure:

Procfile
requirements.txt
static/
myproject/
  manage.py
  app1/
  app2/
  ..

3👍

rm -rf .git
git init 
git add .
git commit -m "First commit"
heroku create --stack cedar
git push heroku master

This worked for me as well !

2👍

Since Django is a python app, you’ll need to have requirements.txt and setup.py sit in the root of your repo and not the src sub-directory. See https://github.com/heroku/heroku-buildpack-python/blob/master/bin/detect

2👍

My stupid error was to mispell requirements.txt as the erroneous requirments.txt. I didn’t need setup.py.

Additionally I need to actually store the git repository in Github. Just creating it locally wasn’t enough.

👤hum3

2👍

For everyone deleting their Git history to make this work… the only reason that works is because the initial commit in the new repository contains the necessary files for Heroku to recognize your app.

I ran into this problem because I added the Procfile and requirements.txt for my app and tried to push to Heroku before actually committing them. So when I pushed to Heroku, I wasn’t pushing those files!

Making a commit with all the necessary files and then pushing should solve this problem, and is vastly preferable to deleting your entire Git history.

Hope this helps!

2👍

I struggled with this issue for a long time and the only solution was Vincent van Leeuwen’s, but I didn’t understand why. The problem turned out to be that I was working from a local branch other than master. So when I was running

git push heroku master

I was actually pushing

(local) master->(heroku) master

and not

(local) current_branch -> (heroku) master

as I intended. This failed because my local master branch didn’t have requirements.txt, Procfile, etc.

The solution is:

git push heroku current_branch:master

See heroku docs for more.

Hope this helps.

1👍

Heroku needs a requirements.txt file, which helps Heroku know what dependencies need to be installed for your Django project. You can use a tool generate your requirements.txt file.

Run in command line

pip freeze > requirements.txt

which will create a requirements.txt file with all your installed packages, such as Django, django-registration, etc…

This link may be helpful: http://tutorial.djangogirls.org/deploy/README.html

1👍

My situation is that my codes are needed to save both on Github and Heroku, if I use the following solution, rm -rf .git will delete the connection to my Github, therefore I can’t push my codes to Github.

rm -rf .git
git init 
git add .
git commit -m "First commit"
heroku create --stack cedar-14
git push heroku master

Instead, my solution is as follows:

$ heroku create
$ heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-python.git
$ git push heroku master

0👍

All the above solutions dont mention that what matters is where is your .git initialised. Actually when you try push on heroku you should be doing it from the directory where you had initialsed the git itself.
Also the directory you are uploading should be the one where you have files like

  • requirements.txt, Procfile, virtualenv, manage.py and .gitignore

    etc.
    In short Heroku needs all files to understand the type of project you want to upload so these files should be accessible on the root directory.

-1👍

You need to add the requirement.txt file to git and then push it will work of sure.

Leave a comment