PK iA`VA ) Problem_Set_1/01-Google_App_Engine.en.srt1
00:00:00,000 --> 00:00:05,000
Okay, so for your first homework, what I'd like you to do is get a basic web app online.
2
00:00:05,000 --> 00:00:08,000
This is going to be the foundation for what we're doing in the rest of this class.
3
00:00:08,000 --> 00:00:11,000
So step 1 will be install Google App Engine.
4
00:00:11,000 --> 00:00:14,000
We'll include documentation in the course notes for how to do this,
5
00:00:14,000 --> 00:00:19,000
and you can also use Google's own instructions online.
6
00:00:19,000 --> 00:00:21,000
And we want to install the Python version.
7
00:00:21,000 --> 00:00:27,000
Put online a basic app. All it has to do is print out the words, "Hello, Udacity!"
8
00:00:27,000 --> 00:00:28,000
Nothing fancy.
9
00:00:28,000 --> 00:00:30,000
Just basically get this thing online, and when you've got that working,
10
00:00:30,000 --> 00:00:32,000
submit the URL here.
11
00:00:32,000 --> 00:00:36,000
I'll show you what it looks like on my browser, or my version of it.
12
00:00:36,000 --> 00:00:38,000
Here we are. This is what I've installed.
13
00:00:38,000 --> 00:00:45,000
You can see it's running on appspot.com, which is Google App Engine's domain by default.
14
00:00:45,000 --> 00:00:49,000
All it does is has a simple webpage that prints out, Hello, Udacity!
15
00:00:49,000 --> 00:00:54,000
This is the entire homework. If you get this working, you have succeeded.
16
00:00:54,000 --> 00:00:56,000
For some of you, this should only take 15 minutes or so,
17
00:00:56,000 --> 00:01:01,000
but I realize that installing web apps and packages and things like this
18
00:01:01,000 --> 00:01:03,000
can sometimes be troublesome.
19
00:01:03,000 --> 00:01:06,000
So once we've got this working, we'll have a good foundation to build on
20
00:01:06,000 --> 00:01:08,000
for the rest of the course. Okay, good luck!
PK iA-
M M 2 Problem_Set_1/02-Google_App_Engine_Solution.en.srt1
00:00:00,000 --> 00:00:03,000
Okay guys, I'm going to walk you through the solution to Homework 1,
2
00:00:03,000 --> 00:00:06,000
which is basically just getting Google App Engine online.
3
00:00:06,000 --> 00:00:10,000
The first thing I do is I got to Chrome.
4
00:00:10,000 --> 00:00:12,000
Let's see, we're going to download--
5
00:00:12,000 --> 00:00:14,000
we can go to Google--the Google App Engine page.
6
00:00:14,000 --> 00:00:18,000
I'm going to assume you've signed up to App Engine.
7
00:00:18,000 --> 00:00:21,000
And then we basically go to the getting started for--
8
00:00:21,000 --> 00:00:23,000
I'm using Python 2.7.
9
00:00:23,000 --> 00:00:26,000
Some of you may have more success with 5.
10
00:00:26,000 --> 00:00:29,000
I'm going to use this Hello, World example.
11
00:00:29,000 --> 00:00:32,000
And we're going to create these two files.
12
00:00:32,000 --> 00:00:34,000
One is called helloworld.py,
13
00:00:34,000 --> 00:00:36,000
and the other will be called app.yml.
14
00:00:36,000 --> 00:00:39,000
So let's start with the first one. We'll copy this.
15
00:00:39,000 --> 00:00:41,000
I'll go to my editor, paste this.
16
00:00:41,000 --> 00:00:45,000
We're going to make this say Udacity, if I recall--Udacity.
17
00:00:45,000 --> 00:00:48,000
Let's go ahead and save this.
18
00:00:48,000 --> 00:00:50,000
So I've saved this file.
19
00:00:50,000 --> 00:00:52,000
I'm going to make the other file.
20
00:00:52,000 --> 00:00:56,000
We can just take the contents from the getting started document here--
21
00:00:56,000 --> 00:00:58,000
app.yml--we'll put this in a new file,
22
00:00:58,000 --> 00:01:00,000
and we'll go ahead and save this.
23
00:01:00,000 --> 00:01:02,000
Okay, all is well.
24
00:01:02,000 --> 00:01:04,000
We'll go to my terminal, and we'll go to that directory.
25
00:01:04,000 --> 00:01:07,000
I called it Unit 1 Homework; it's where I save these two files.
26
00:01:07,000 --> 00:01:09,000
You see, there they are.
27
00:01:09,000 --> 00:01:12,000
And then to run it locally, it always says we run divappserver.
28
00:01:12,000 --> 00:01:15,000
This is the console way of running Google App Engine code.
29
00:01:15,000 --> 00:01:17,000
Many of you are probably using a GUI.
30
00:01:17,000 --> 00:01:19,000
I prefer to use the console version.
31
00:01:19,000 --> 00:01:22,000
It makes it a little bit easier. You don't have to add projects and that sort of stuff.
32
00:01:22,000 --> 00:01:24,000
I'm going to run it on a different port.
33
00:01:24,000 --> 00:01:26,000
That's what the P command is for,
34
00:01:26,000 --> 00:01:28,000
because I share this machine with other instructors
35
00:01:28,000 --> 00:01:31,000
and somebody is already using the default 8080.
36
00:01:31,000 --> 00:01:34,000
And then we just run it in the current directory. That's what period does.
37
00:01:34,000 --> 00:01:37,000
Okay, so this starts up.
38
00:01:37,000 --> 00:01:39,000
It complains a little bit about some missing APIs.
39
00:01:39,000 --> 00:01:41,000
We're not using the image API, so it doesn't matter.
40
00:01:41,000 --> 00:01:43,000
And then we go to our browser,
41
00:01:43,000 --> 00:01:46,000
and we can go to local host 8888,
42
00:01:46,000 --> 00:01:49,000
and there we see it.
43
00:01:49,000 --> 00:01:51,000
Hello, Udacity.
44
00:01:51,000 --> 00:01:53,000
So all is moving.
45
00:01:53,000 --> 00:01:55,000
We can play around with things a little bit.
46
00:01:55,000 --> 00:01:58,000
If I wanted to change the text here,
47
00:01:58,000 --> 00:02:02,000
I can change it, save it, go to Chrome, reload, more exclamation marks--pretty cool.
48
00:02:02,000 --> 00:02:05,000
Now, when I want to put this online,
49
00:02:05,000 --> 00:02:08,000
all I do is instead of using divappserver,
50
00:02:08,000 --> 00:02:13,000
what I use instead is update app cfg update,
51
00:02:13,000 --> 00:02:16,000
and I can run it in my current directory, and this will upload the app.
52
00:02:16,000 --> 00:02:19,000
I'm not actually going to run this for you because
53
00:02:19,000 --> 00:02:22,000
this would override my other homeworks that are already online
54
00:02:22,000 --> 00:02:25,000
that are--you guys can use for demos.
55
00:02:25,000 --> 00:02:28,000
But basically all I do is I hit Enter here,
56
00:02:28,000 --> 00:02:31,000
and it chatters at me for a little while, and then we're done.
57
00:02:31,000 --> 00:02:33,000
The homework was intended to be very simple,
58
00:02:33,000 --> 00:02:36,000
but I realize that actually getting App Engine running on different platforms can be troublesome,
59
00:02:36,000 --> 00:02:39,000
and getting the Python versions in synch can be troublesome.
60
00:02:39,000 --> 00:02:43,000
I hope you guys have worked through all those things.
61
00:02:43,000 --> 00:02:45,000
And that's it for Homework 1.
62
00:02:45,000 --> 00:02:47,000
All I wanted to do was get this basic website online.
63
00:02:47,000 --> 00:02:49,000
There it is in my local machine.
64
00:02:49,000 --> 00:02:52,000
And if I were to go to where I've already got it uploaded--
65
00:02:52,000 --> 00:02:56,000
I think I can go to udacitycs253appspot.com,
66
00:02:56,000 --> 00:02:58,000
where I've uploaded it prevoiusly,
67
00:02:58,000 --> 00:03:01,000
and there it is--Hello, Udacity.
68
00:03:01,000 --> 99:59:59,000
So all is well. Good job, if you got that.
PK iA`VA ) Problem_Set_1/01-Google_App_Engine.en.srtPK iA-
M M 2 Problem_Set_1/02-Google_App_Engine_Solution.en.srtPK }