Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revisions to Deploy chapter #197

Merged
merged 2 commits into from
Nov 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deploy!

__Note__ Following chapter can be sometimes a bit harder to get through. Insist on finishing it, deployment is an important part of website development process. Chapter is placed in the middle of tutorial so that mentor can help you get your website online while you can still finish the tutorial alone if you run out of time.
> __Note__ The following chapter can be sometimes a bit hard to get through. Persist and finish it; deployment is an important part of the website development process. This chapter is placed in the middle of the tutorial so that your mentor can help with the slightly tricker process of getting your website online. This means you can still finish the tutorial on your own if you run out of time.

Until now your website was only available on your computer, now you will learn how to deploy it! Deploying is the process of publishing your application on the Internet so people can finally go and see your app :).

Expand Down Expand Up @@ -118,10 +118,9 @@ Then authenticate your Heroku account on your computer by running this command:
In case you don't have an SSH key this command will automatically create one. SSH keys are required to push code to the Heroku.

## Git
Git is a version control system used by a lot of programmers - software which keeps track of changes to a file or set of files over time so that you can recall specific versions later. Heroku uses a git repository to manage your project files, so we need to use it too.

Heroku uses a git repository to manage your project files, so we need to use it too.

Create `.gitignore` file with the following content:
Create a file named `.gitignore` in your `djangogirls` directory with the following content:

myvenv
__pycache__
Expand Down Expand Up @@ -151,15 +150,15 @@ Next, we’ll create a new git repository and save our changes. Go to your conso

## Deploy to Heroku!

It was a lot of configuration and installing, right? But you need to do that once! Now you can deploy!
That was a lot of configuration and installing, right? But you only need to do that once! Now you can deploy!

It's as simple as running this command, replacing `djangogirlsblog` with your own application name:

$ heroku create djangogirlsblog

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

This automatically added the Heroku remote for our app to our repository. Now we can do a simple git push to deploy our application:
This automatically added the Heroku remote for our app to our repository. Now we can do a simple git push to deploy our application:

$ git push heroku master

Expand All @@ -178,13 +177,13 @@ We can now visit the app in our browser with `heroku open`.

$ 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.
> __Note__: you will see an error page! We'll talk about that in a minute

We created a new database on Heroku, but we also need to sync it:
This will open a url like [https://djangogirlsblog.herokuapp.com/]() in your browser, and at the moment you will probably see an error page. 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.

$ heroku run python manage.py migrate
The error you saw was because we when we deployed to Heroku, we created a new database and it's empty. We need to run the ```migrate``` command like we did when we first started our project to set our database up properly:

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 migrate

$ heroku run python manage.py createsuperuser

Expand Down