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
command for heruku. But the problem is when i make a commit it is directly committed to the git not to the heroku.
- virtualenv, python and subversion
- Best practice to deploy python app to use a specific version of Python with venv
- how to automate a push to repo using gitpython
- git-dulwich:how to merge or rebase?
- git svn dcommit -> pass password through stdin
- Patch Django Site Package From a Pull Request Using Pip
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.
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
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