English subtitles

← Google App Engine Solution - Web Development

Get Embed Code
4 Languages

Showing Revision 15 created 09/03/2017 by Dejan Trajkovic.

  1. Okay guys, I'm going to walk you through the solution to Homework 1,
  2. which is basically just getting Google App Engine online.
  3. The first thing I do is I go to Chrome.
  4. Let's see, we're going to download--
  5. we can go to Google--the Google App Engine page.
  6. I'm going to assume you've signed up to App Engine.
  7. And then we basically go to the getting started for--
  8. I'm using Python 2.7.
  9. Some of you may have more success with 5.
  10. I'm going to use this Hello, World example.
  11. And we're going to create these two files.
  12. One is called helloworld.py,
  13. and the other will be called app.yaml.
  14. So let's start with the first one. We'll copy this.
  15. I'll go to my editor, paste this.
  16. We're going to make this say Udacity, if I recall--Udacity.
  17. Let's go ahead and save this.
  18. So I've saved this file.
  19. I'm going to make the other file.
  20. We can just take the contents from the getting started document here--
  21. app.yml--we'll put this in a new file,
  22. and we'll go ahead and save this.
  23. Okay, all is well.
  24. We'll go to my terminal, and we'll go to that directory.
  25. I called it Unit 1 Homework; it's where I save these two files.
  26. You see, there they are.
  27. And then to run it locally, it always says we run dev_appserver.
  28. This is the console way of running Google App Engine code.
  29. Many of you are probably using a GUI.
  30. I prefer to use the console version.
  31. It makes it a little bit easier. You don't have to add projects and that sort of stuff.
  32. I'm going to run it on a different port.
  33. That's what the P command is for,
  34. because I share this machine with other instructors
  35. and somebody is already using the default 8080.
  36. And then we just run it in the current directory. That's what period does.
  37. Okay, so this starts up.
  38. It complains a little bit about some missing APIs.
  39. We're not using the image API, so it doesn't matter.
  40. And then we go to our browser,
  41. and we can go to local host 8888,
  42. and there we see it.
  43. Hello, Udacity.
  44. So all is moving.
  45. We can play around with things a little bit.
  46. If I wanted to change the text here,
  47. I can change it, save it, go to Chrome, reload, more exclamation marks--pretty cool.
  48. Now, when I want to put this online,
  49. all I do is instead of using dev_appserver,
  50. what I use instead is update app cfg update,
  51. and I can run it in my current directory, and this will upload the app.
  52. I'm not actually going to run this for you because
  53. this would override my other homeworks that are already online
  54. that are--you guys can use for demos.
  55. But basically all I do is I hit Enter here,
  56. and it chatters at me for a little while, and then we're done.
  57. The homework was intended to be very simple,
  58. but I realize that actually getting App Engine running on different platforms can be troublesome,
  59. and getting the Python versions in synch can be troublesome.
  60. I hope you guys have worked through all those things.
  61. And that's it for Homework 1.
  62. All I wanted to do was get this basic website online.
  63. There it is in my local machine.
  64. And if I were to go to where I've already got it uploaded--
  65. I think I can go to udacitycs253appspot.com,
  66. where I've uploaded it prevoiusly,
  67. and there it is--Hello, Udacity.
  68. So all is well. Good job, if you got that.