You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/deploy/README.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Deploy!
2
2
3
-
> __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.
3
+
> __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.
4
4
5
5
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 :).
6
6
@@ -50,7 +50,7 @@ We need to tell Heroku which Python version we want to use. This is done by crea
50
50
51
51
## mysite/local_settings.py
52
52
53
-
There is a difference between settings we are using locally (on our computer) and settings for our server. Heroku is using one database, and your computer is using a different database. That's why we need to create a seperate file for settings that will only be available for our local enviroment.
53
+
There is a difference between settings we are using locally (on our computer) and settings for our server. Heroku is using one database, and your computer is using a different database. That's why we need to create a separate file for settings that will only be available for our local environment.
54
54
55
55
Go ahead and create `mysite/local_settings.py` file. It should contain your `DATABASE` setup from your `mysite/settings.py` file. Just like that:
56
56
@@ -73,7 +73,7 @@ Then just save it! :)
73
73
Another thing we need to do is modify our website's `settings.py` file. Open `mysite/settings.py` in your editor and add the following lines at the end of the file:
@@ -88,7 +88,7 @@ Another thing we need to do is modify our website's `settings.py` file. Open `my
88
88
except ImportError:
89
89
pass
90
90
91
-
It'll do necessary configuration for Heroku and also it'll import all of your local settings if the file exists.
91
+
It'll do necessary configuration for Heroku and also it'll import all of your local settings if `mysite/local_settings.py` exists.
92
92
93
93
Then save the file.
94
94
@@ -109,7 +109,7 @@ You need to install your Heroku toolbelt which you can find here (you can skip t
109
109
110
110
> On Windows you also must run the following command to add Git and SSH to your command prompt's `PATH`: `setx PATH "%PATH%;C:\Program Files\Git\bin"`. Restart the command prompt program afterwards to enable the change.
111
111
112
-
> After restarting your command prompt, don't forget to go to your `djangogirls` folder again and activate your virtualenv! (Hint: [Check the django installation chapter](../django_installation/README.md#working-with-virtualenv))
112
+
> After restarting your command prompt, don't forget to go to your `djangogirls` folder again and activate your virtualenv! (Hint: [Check the Django installation chapter](../django_installation/README.md#working-with-virtualenv))
113
113
114
114
Please also create a free Heroku account here: https://id.heroku.com/signup/www-home-top
115
115
@@ -120,7 +120,7 @@ Then authenticate your Heroku account on your computer by running this command:
120
120
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.
121
121
122
122
## Git
123
-
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.
123
+
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.
124
124
125
125
Create a file named `.gitignore` in your `djangogirls` directory with the following content:
126
126
@@ -177,7 +177,7 @@ If you ever feel like changing the name of your Heroku application, you can do s
177
177
178
178
$ heroku apps:rename the-new-name
179
179
180
-
> __Note__: Remember that after you change your application's name, you'll need to visit `[thenewname].herokuapp.com` to see your site.
180
+
> __Note__: Remember that after you change your application's name, you'll need to visit `[the-new-name].herokuapp.com` to see your site.
181
181
182
182
## Deploy to Heroku!
183
183
@@ -204,18 +204,16 @@ We can now visit the app in our browser with `heroku open`.
204
204
205
205
$ heroku open
206
206
207
-
> __Note__: you will see an error page! We'll talk about that in a minute
207
+
> __Note__: you will see an error page! We'll talk about that in a minute.
208
208
209
209
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.
210
210
211
-
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:
211
+
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:
212
212
213
213
$ heroku run python manage.py migrate
214
214
215
215
$ heroku run python manage.py createsuperuser
216
-
216
+
217
217
The command prompt will ask you to choose a username and a password again. These will be your login details on your live website's admin page. Refresh it in your browser, and you're good to go!
218
218
219
219
You should now be able to see your website in a browser! Congrats :)!
0 commit comments