Skip to content

Commit

Permalink
Removed remaining examples of heroku push and added basic git workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmispelon committed Nov 15, 2014
1 parent b989c1f commit 539448d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 22 deletions.
8 changes: 4 additions & 4 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,23 @@ We can now tell Heroku to start this `web process`.

To do that, run the following command:

$ heroku ps:scale web=1 --app djangogirlsblog
$ heroku ps:scale web=1

This tells Heroku to run just one instance of our `web` process. Since our blog application is quite simple, we don't need too much power and so it's fine to run just one process. It's possible to ask Heroku to run more processes (by the way, Heroku calls these processes "Dynos" so don't be surprised if you see this term) but it will no longer be free.

We can now visit the app in our browser with `heroku open`.

$ heroku open --app djangogirlsblog
$ heroku open

This will open a url like [https://djangogirlsblog.herokuapp.com/]() in your browser. Since we only created the admin view for the app so far, add `admin/` to the url (e.g. [https://djangogirlsblog.herokuapp.com/admin/]()) to see a working page of our web app.

We created a new database on Heroku, but we also need to sync it:

$ heroku run python manage.py migrate --app djangogirlsblog
$ heroku run python manage.py migrate

As you can see, there is an error. Heroku created a new database for us and it's empty. We also need to sync it:

$ heroku run python manage.py createsuperuser --app djangogirlsblog
$ heroku run python manage.py createsuperuser

You should now be able to see your website in a browser! Congrats :)!

Expand Down
15 changes: 10 additions & 5 deletions django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,15 @@ If you need more information about Django forms you should read the documentatio

## One more thing: deploy time!

It'd be good to see if your website will be still working on Heroku, right? Let's try deploying again. Open up your console and type this:

heroku push --app djangogirlsblog

> __Note__: Remember to replace `djangogirlsblog` with the name of your application on Heroku.
It'd be good to see if your website will still be working on Heroku, right? Let's try deploying again. If you forgot how to do it, check the end of chapter 15:

$ git status
...
$ git add -A .
$ git status
...
$ git commit -m "Added views to create/edit blog post inside the site."
...
$ git push heroku master

And that should be it! Congrats :)
15 changes: 10 additions & 5 deletions django_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ Have you noticed that we used a slightly different notation this time `{{ post.t

## One more thing

It'd be good to see if your website will still be working on Heroku, right? Let's try deploying again. Open up your console and type this:

heroku push --app djangogirlsblog

> __Note__: Remember to replace `djangogirlsblog` with the name of your application on Heroku.
It'd be good to see if your website will still be working on Heroku, right? Let's try deploying again. If you forgot how to do it, check the end of chapter 15:

$ git status
...
$ git add -A .
$ git status
...
$ git commit -m "Used Django templates instead of static HTML."
...
$ git push heroku master

Congrats! Now go ahead and try adding a new post in your Django admin (remember to add published_date!), then refresh your page to see if the post appears there.

Expand Down
15 changes: 10 additions & 5 deletions extend_your_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,15 @@ Yay! It works!

## One more thing: deploy time!

It'd be good to see if your website will be still working on Heroku, right? Let's try deploying again. Open up your console and type this:

heroku push --app djangogirlsblog

> __Note__: Remember to replace `djangogirlsblog` with the name of your application on Heroku.
It'd be good to see if your website will still be working on Heroku, right? Let's try deploying again. If you forgot how to do it, check the end of chapter 15:

$ git status
...
$ git add -A .
$ git status
...
$ git commit -m "Added more views to the website."
...
$ git push heroku master

And that should be it! Congrats :)
26 changes: 23 additions & 3 deletions html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,30 @@ What we want really want to do is display real posts added in our Django admin -

## One more thing

It'd be good to see if your website will be still working on Heroku, right? Let's try deploying again. Open up your console and type this:
It'd be good to see if your website will be still working on Heroku, right? Let's try deploying again.

heroku push --app djangogirlsblog
First off, let's see what files have changed since we last deployed:

> __Note__: Remember to replace `djangogirlsblog` with the name of your application on Heroku.
$ git status

Let's tell `git` to include all the changes from the current directory:

$ git add -A .

> __Note__ `-A` (short for "all") means that `git` will also recognize if you've deleted files (by default, it only recognizes new/modified files). Also remember (from chapter 3) that `.` means the current directory.
Before we upload all the files, let's check what `git` will be uploading (all the files that `git` will upload should now appear in green):

$ git status

We're almost there, now it's time to tell it to save this change in its history. We're going to give it a "commit message" where we describe what we've changed. You can type anything you'd like at this stage, but it's helpful to type something descriptive so that you can remember what you've done in the future.

$ git commit -m "Changed the HTML for the site."

> __Note__ Make sure you use double quotes around the commit message.
Once we've done that, we can finally upload (push) our changes to the website on heroku:

git push heroku master

And that should be it! Once Heroku is finished, you can go ahead and refresh your website in the browser. Changes should be visible!

0 comments on commit 539448d

Please sign in to comment.