Deploy a pre existing django git repo to heroku

I have a DJango git repository.Me and some other developers are working on it and it has multiple branchs also. Now i want to deploy it to Heroku or want to use the heroku as a staging server means before pushing to git i want to push the code changes to heroku and if verified will push changes to git. For this i have created a heroku app using this git repo by running

heroku create 

command for heruku. But the problem is when i make a commit it is directly committed to the git not to the heroku.

I have tried to delete the heroku app from the local git repo by running

 `heroku apps:destroy –a guarded-tundra-1589 --confirm` 

but when i again tried to push the heroku master code is pushed to it. means it doesn’t get deleted.

Tell me the right way to deploy the project which already has a git repo to heroku.

  • Using DVCS for an RDBMS audit trail
  • What should I put in requirements file for pip to pick the correct git branch?
  • Python - A Git module which doesn't depend on the git binary file
  • Error message “no theme named 'sphinx-theme-okfn'” when trying to build CKAN's docs
  • Why can't my post-receive hook run a virtualenv source command?
  • ERROR virtualenvwrapper in GitBash
  • Run shell script from python with permissions
  • Python: How to connect to a protected svn repository with setuptools
  • 2 Solutions collect form web for “Deploy a pre existing django git repo to heroku”

    There are standart Heroku commands to do this:

    $ heroku auth:login
    ... output omitted ...
    $ heroku create --stack cedar
    ... output omitted ...
    $ git commit -a -m 'Mods to run on Heroku.'
    $ git push heroku master
    

    UPDATE:

    Also if you are planning to use Heroku in future it could be useful frt you to check their official Documentation – Getting Started with Django on Heroku

    This will delete your repo, but this what worked for me when I got that error.

    rm -rf .git
    git init 
    git add .
    git commit -m "First commit"
    heroku create --stack cedar
    git push heroku master
    
    Git Baby is a git and github fan, let's start git clone.