Locked lesson.
About this lesson
At some point, you'll want to upload you new website project to a web host. In this lesson, we'll discuss how to install the Heroku Toolbelt as one option for your web hosting solution.
Exercise files
Download this lesson’s related exercise files.
Install Heroku Toolbelt.docx57.6 KB Install Heroku Toolbelt - Solution.docx
56.2 KB
Quick reference
Install Heroku Toolbelt
To push our code to Heroku for web hosting, we need to install the Heroku toolbelt.
When to use
Install it once.
Instructions
Download the heroku tool belt from here:
https://devcenter.heroku.com/articles/heroku-cli
Once you run the installation wizard, restart your git bash terminal. Be sure to turn your virtual environment back on!
Hints & tips
- https://devcenter.heroku.com/articles/heroku-cli
- Remember to restart your git bash terminal after installation.
- 00:04 Okay, in this video, I want to start to talk about web hosting,
- 00:06 what we're going to be using, and we need to install a tool in order to use it.
- 00:09 So for this course, I'm recommending that we use Heroku for web hosting.
- 00:14 Heroku is a super popular web hosting company.
- 00:18 They've been around forever.
- 00:19 They are top notch.
- 00:21 And the reason why I like them is because they have a free tier.
- 00:24 And that's what we're going to use for this course.
- 00:27 Now, the free tier doesn't work that great.
- 00:29 I mean, it works fine, it's just not very powerful.
- 00:32 So only a few people can come to your website at the same time before
- 00:35 the website starts to get very slow, right?
- 00:38 And then if you want it to be faster when more people come, you have to sign up, or
- 00:42 you have to actually pay more.
- 00:44 And you can look on pricing, it's very reasonably priced.
- 00:46 See there's a free tier, there's a hobby tier that's a little more powerful.
- 00:51 That's $7 a month, that's not bad, right?
- 00:53 And as you make it more powerful, you're adding dynos, and
- 00:57 you can see the price goes up based on that.
- 00:59 Now that's great, because you can scale your website as it becomes more popular.
- 01:03 And you don't have to pay for it until it becomes more popular.
- 01:07 And then scaling it up is as easy as clicking a button, and it's super easy.
- 01:11 So like I said, I recommend the free tier.
- 01:13 So go ahead and sign up for an account.
- 01:16 They may ask for your credit card.
- 01:17 They used to, years ago, even for free accounts.
- 01:18 But these guys are a solid company,
- 01:20 they're not going to charge you unless you sign up for something that costs money.
- 01:26 So you don't have to worry about that.
- 01:28 In order to use Heroku, we need something called the Heroku Toolbelt.
- 01:31 So let's go ahead and install that right now.
- 01:33 So just go to Google and type in Heroku Toolbelt.
- 01:37 And it's down here, it's the third one listed.
- 01:41 And the URL is devcenter.heroku.com/articles/heroku-cli,
- 01:46 cli stands for command line interface.
- 01:49 So I'll put a link to this in the resource files of this course.
- 01:55 So just scroll down here, and whatever OS you have, Mac, Windows, or Linux,
- 01:59 you can just download the installer for it.
- 02:01 So we're on Windows, we want the 64-bit installer.
- 02:05 You're almost certainly going to want the 64-bit installer.
- 02:08 So just go ahead and save it.
- 02:10 And you can save this anywhere.
- 02:11 I'm just going to save it to my desktop, doesn't really matter.
- 02:15 And now I'm on Firefox, so my downloads are up here.
- 02:18 If you're on Chrome, your downloads are going to be down here.
- 02:22 Wherever it is, just go ahead and click on it.
- 02:25 And then just click this to run it, and here's the screen that pops up.
- 02:28 We just want to make sure all of these are checked, and then just click Next.
- 02:33 And then go ahead and click Install.
- 02:35 Now I'm not going to do this, because I've already installed this.
- 02:39 But you can go ahead and do that.
- 02:40 It will go through a little countdown thing that installs it.
- 02:41 And when it's finished, you can just close it.
- 02:46 So I'm going to go ahead and cancel it.
- 02:47 Now, the one thing that's important is you need to restart your Git Bash
- 02:52 terminal in order for this to take effect.
- 02:55 So come up here and close this out.
- 02:58 And be sure when you open it again to come back to your
- 03:01 /c/mywebsite/djangowebsite directory and engage your virtual environment.
- 03:06 That's so important.
- 03:08 In fact, in case you've forgotten, I'm going to go ahead and
- 03:12 just open up another Git Bash terminal and pull it over here.
- 03:16 And let's just walk through this really quickly.
- 03:20 So we want to cd into /c/my website.
- 03:24 And when we do that, we see ls.
- 03:25 Here's our virtual directory.
- 03:28 So remember to turn on our virtual environment,
- 03:32 we type in source and then virtual/Scripts/activate.
- 03:36 And when we do, we see this (virtual) thing.
- 03:40 Now we need to cd into our /djangowebsite directory.
- 03:45 Oops, cd into our djangowebsite directory, no slash at the beginning of it.
- 03:52 And when we do, we see (master).
- 03:53 So I'm going to go ahead and clear the screen and type in ls again.
- 03:58 We see the manage.py file, so we know we're in the right place.
- 04:01 We see this (master), so we know that our Git has been initiated.
- 04:05 And we see this (virtual) thing, so we're good to go.
- 04:09 So just to be sure, we can type in heroku --version.
- 04:11 And if something pops up, like we see here a bunch of numbers,
- 04:15 that means that it's been installed correctly.
- 04:18 It's telling me there's an update available.
- 04:20 That doesn't matter, I'm just going to keep my current version.
- 04:24 If you get an error or something, if you don't see numbers that look vaguely like
- 04:28 this, they may look different, because you may be downloading a different version.
- 04:32 I'm on 7.30, you're going to download 7.33 or above,
- 04:37 depending on when you watch this video.
- 04:39 But as long as you see something there, that means that the Heroku Toolbelt has
- 04:43 been installed correctly, and you're ready to go.
- 04:45 So in the next video, we'll start to push our code up to Heroku.
Lesson notes are only available for subscribers.