Repo from heroku to github - django

I'm kind of new in this of heroku and github, but what I want to do is put a Django application in heroku to my github account. How can I do that from console or something?

You have a local git repository of your code that you pushed to heroku. Now you just got to http://github.com (create an account if you haven't yet) and a repository for your project. You will then get the instructions to push your existing code to the newly created repo.

Related

Fork Heroku app to local

Sorry for the basic question, but how can I fork an Heroku app to the local machine? I deployed a simple Django app, added some data to the app online and now I want to fork the app to my friend's laptop so he can continue to fill in the data for me (let say he don't have the internet). I tried heroku fork but it does not work, the forked repository doesn't have the data I added before and the account that I created for my friend...
I tried heroku fork but it does not work, the forked repository doesn't have the data I added before
That data must be pushed before:
git push heroku master
Then a fork can be done.
Note that forking an application doesn’t automatically create a new git remote in your current project.
Use heroku info to retrieve the Git URL of the new application and the set it manually.
Once you have the git url for the fork, you can clone it, and add an upstream remote url referencing the source heroku Git repo.
Your friend can then update his/her local clone of that fork without having to heroku fork each time.

Deploy Django App on Azure: only displays default app, even after deployment

I am trying to deploy a webapp to Azure. I am following these directions https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/
First step, I created a webapp (Django) on the portal.
Then it says to follow the directions to configure Continuous deployment using GIT in Azure App Service. This should apparently lead to my having a local directory of Django files. https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
So I follow those directions, installing Git, creating a local repository, adding a webpage, enabling web app repository, deploying.
The webportal now shows that I have deployed ('active' deployment). However, when I go to the web app url, what's showing is NOT what I deployed, but rather what I guess is the default Django app with its urls (login, logout, contacts).
So then I create an actual Django app in my local directory (instead of the static index.html from the directions). I commit and push it to Azure. It shows as being deployed.
The result is the same as before: the default web app is showing.
So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)
Things are working as expected, but you ended up overwriting the Django app in your first the Git commit. The Continuous Deployment instructions as written are generic to any deployment, even a blank Web App.
So what I'm missing is the connection between my local repository and what's actually showing. Is there some way to pull the Azure default app into my local repository? (Once it's there, I'll be able to change it as I see fit.)
All you need to do is git clone your repo after you've initialized your local Git repo on the Azure Web App. You've already gone through most of these steps, but I'll include them here for others who may be looking for this answer.
After you create the Django Web App from the Azure Marketplace/Gallery, scroll down to set up continuous deployment.
Choose Local Git repo.
Notice that you now have a Git Clone URL in both your Quickstart Essentials info and under All Settings >> Properties. Go ahead and copy this URL.
If you haven't already done so, you may need to set or reset your Deployment Credentials. You'll find this under All Settings. This will be your Git & FTP credentials. Note that this is actually the credentials for your Microsoft Account, not just this one Web App.
You already have Git installed from your first attempt. You should now be able to navigate to the folder you want to clone the repo into and run:
git clone <your_git_clone_url>
After you type in your password, you'll have a cloned repo of the Django Web App on your local system. cd into the directory and start working from there. Once you have changes, git add ., git commit, and git push them back to the repo in Azure to see your changes there.

Is it possible to deploy a django project to heroku without putting the project in git?

I was wondering if it is possible to deploy to heroku with out putting my django project on git?
My another question. I already have my app on heroku. Now I want to make changes to it. But the computer I had the soruce code crashed. So how do I download my project files from heroku?
No. ( But there is a plugin to do that, but I would say why bother. But.. - https://github.com/ddollar/heroku-push)
But all you have to do is git init to setup a repo, and push to the heroku remote after setting up an app. You don't have to publish your repo anywhere.
You can get back your code by using:
heroku clone <appname>

How should I stage my bitbucket + heroku django app for development and deployment?

How should I stage my bitbucket + heroku django app for development and deployment?
I'm working on a Django App.
I don't want to use github because I want to host have a private repo.
So right now I know how to deploy an app on heroku but how do I do it through bitbucket?
What is this deployment key stuff?
Do I have to reset my git remote origins or something?
Do I deploy with different folders? and commit my source code to different folders?
What happens when I want scale up my development environment to multiple computers?
I know I will be using git to monitor changes to the repo, how should I allow all of them to deploy to heroku?
Thanks
Change your git remote to point to your bitbucket URL, then proceed as normal.
Your remote origin would be the URL to your bitbucket found in settings. Your remote heroku would be pointing to Heroku.
#dan-hoerst's answer is still correct but I wanted to draw attention to heroku's new pipeline feature which lets you handle your staging and production environment better way.
A pipeline is a group of Heroku apps that share the same codebase.
Apps in a pipeline are grouped into “review”, “development”,
“staging”, and “production” stages representing different deployment
steps in a continuous delivery workflow.
You can find more about it here https://devcenter.heroku.com/articles/pipelines

Two Heroku Apps for the Same Project?

I currently have a django project deployed on Heroku, but I would like to deploy another dummy Heroku app for testing purposes. The idea is that I can make changes to the dummy Heroku account on a git branch, see how it works live, and then merge and push to my actual Heroku project. Is this possible?
I haven't tried this but I don't see why it wouldn't be possible.
Just add another remote on git to the repository to your production heroku git address.
git remote add htest your_test_app_heroku.git
git remote add heroku your_actual_app_heroku.git