Google App Engine An Example!. Schedule Today: AppEngine and Python Wednesday: Review and CES! Friday Quiz!!! Next week: – DEMO MADNESS!!! – Approx 20.

Slides:



Advertisements
Similar presentations
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
Advertisements

CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
Google App Engine Cloud B. Ramamurthy 7/11/2014CSE651, B. Ramamurthy1.
When are projects due? #infomgmtFAIL – This is why you never duplicate data. – Project 4 is Due To get it done in time you will need to work smart, cut.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Python and Web Programming
MCS 270 Spring 2014 Object-Oriented Software Development.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
Creating a Hello App Using Google App Engine. What are Google apps? Apps is an abbreviation for application. An app is a piece of software. It can run.
Platform as a Service (PaaS)
Google AppEngine. Google App Engine enables you to build and host web apps on the same systems that power Google applications. App Engine offers fast.
Google App Engine Google APIs OAuth Facebook Graph API
By: Devesh Sharma.  Why Cloud Computing? ◦ Traditional Business Applications  Expensive  Complicated  Difficult to manage  Idea behind Cloud Computing.
Google App Engine Danail Alexiev Technical Trainer SoftAcad.bg.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Prof. A.R. Rele. What Is Google App Engine? Google App Engine lets users run web applications on Google's infrastructure. App Engine applications are.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Lecture 8 – Platform as a Service. Introduction We have discussed the SPI model of Cloud Computing – IaaS – PaaS – SaaS.
Module 5: Managing Public Folders. Overview Managing Public Folder Data Managing Network Access to Public Folders Publishing an Outlook 2003 Form Discussion:
Google App Engine Chien-Chung Shen
Googe App Engine Codelab Marzia Niccolai May 28-29, 2008.
Cloud computing lectures: Programming with Google App Engine Keke Chen.
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
JSP Java Server Pages Softsmith Infotech.
Meet with the AppEngine Márk Gergely eu.edge. What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Chapter 6 Server-side Programming: Java Servlets
CSC 2720 Building Web Applications Server-side Scripting with PHP.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
App Engine Web App Framework Jim Eng
Table of Contents TopicSlide Administrator Login 2 Administrator Navigations 3 Managing AlternativeDr.com Blogs 4 Managing Dr. Lloyd May Blogs 5 Managing.
1 Final Review. 2 Final Exam  30% of your grade for the course  December 9 at 7:00 p.m., the regular class time  No makeup exam or alternate times.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/7/10.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
 An essential supporting structure of any thing  A Software Framework  Has layered structure ▪ What kind of functions and how they interrelate  Has.
Google App Engine Mano Marks Developer Advocate. Problems building web applications Why Google App Engine? The App Engine Components What’s Next Questions?
Ping Yeh, Software Engineer Chris Schalk, Developer Advocate Google App Engine.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
ArcGIS for Server Security: Advanced
4.01 How Web Pages Work.
Platform as a Service (PaaS)
4.01 How Web Pages Work.
Installation The Intercompany Integration Solution for SAP Business One Version 2.0 for SAP Business One 9.1 Welcome to the course on the installation.
Development Environment
Platform as a Service (PaaS)
Chapter 8 Browsing and Searching the Web
Platform as a Service (PaaS)
Node.js Express Web Applications
Google App Engine Mandeep Singh (37926)
Data Virtualization Tutorial… CORS and CIS
Play Framework: Introduction
Platform as a Service.
Administrator Training
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
Google App Engine B. Ramamurthy Based on the material available at
Installation The Intercompany Integration Solution for SAP Business One Version 2.0 for SAP Business One 9.1 Welcome to the course on the installation.
Google App Engine Danail Alexiev
Web Server Design Week 15 Old Dominion University
Google App Engine Ying Zou 01/24/2016.
Module P3 Practical: Building a webapp in nodejs and
Computer Networks Primary, Secondary and Root Servers
4.01 How Web Pages Work.
Web Server Design Week 14 Old Dominion University
Mr. Justin “JET” Turner CSCI 3000 – Fall 2016 Section DA MW 4:05-5:20
Presentation transcript:

Google App Engine An Example!

Schedule Today: AppEngine and Python Wednesday: Review and CES! Friday Quiz!!! Next week: – DEMO MADNESS!!! – Approx 20 people per class… – 2minutes each! – Laptop will be available for URL!

Course Admin notes! ONE more lab next week! Check your grades on Connex! No final exam – But final project is due Friday Nov 30!

Google App Engine no charge, no commitment run an application on a server… Python, Java, Go tutorials online – build an App Engine application using Python – use the "webapp2" web application framework – use the App Engine datastore – Integrate with Google Accounts for user authentication – use Jinja2 templates with your app – (upload your app to App Engine)

The Development Environment download an SDK start editing files! EXAMPLE – ython/gettingstartedpython27/ – Python script responds to a request on the server! – Creates an HTTP header that describes the content and the message Hello, world!.

Sample!

Configuration File… app.yaml – "Yet Another Markup Language", – "YAML Ain't Markup Language" among other things, this file describes which handler scripts should be used for which URLs.

app.yaml

Say WHAT?! application identifier is helloworld version number 1. App Engine will retain previous versions, and let you roll back to a previous version using the administrative console runs in the python27 runtime environment threadsafe so the same instance can handle several simultaneous requests. requests to a URL whose path matches the regular expression /.* (all URLs) should be handled by the app object in the helloworld module.

Show time! a handler script and configuration file mapping every URL to the handler, the application is complete! you can now test it with the web server included with the App Engine SDK. Google App Engine Launcher, – you can set up the application by selecting the File menu, Add Existing Application..., then selecting the helloworld directory – select the application in the app list, click the Run button to start the application, then click the Browse button to view it. – clicking Browse simply loads (or reloads) in your default web browser.

The Launcher…

webapp2 App Engine includes a simple web application framework, called webapp2 A webapp2 application has two parts: – one or more RequestHandler classes that process requests and build responses – a WSGIApplication instance that routes incoming requests to handlers based on the URL

In the code again…

what does it all mean? one request handler, MainPage, mapped to the root URL (/) webapp2 receives an HTTP GET request to the URL /, it instantiates the MainPage class and calls the get method. – information about the request is available using self.request. Typically, the method sets properties on self.response to prepare the response, then exits. webapp2 sends a response based on the final state of the MainPage instance.

The Users API user = users.get_current_user() returns the User object for the user. Otherwise, it returns None. if user: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, ' + user.nickname()) If the user has signed in, display a personalized message, using the nickname associated with the user's account else: self.redirect(users.create_login_url(self.request.uri)) If the user has not signed in, tell webapp2 to redirect the user's browser to the Google account sign-in screen.

Handling Web Forms with webapp2

Holy cow!

How? This version has two handlers: – MainPage, mapped to the URL /, displays a web form. – Guestbook, mapped to the URL /sign, displays the data submitted by the web form. The Guestbook handler has a post() method instead of a get() method. This is because the form displayed by MainPage uses the HTTP POST method (method="post") to submit the form data – gets the form data from self.request – it uses cgi.escape() to escape HTML special characters to their character entity equivalents. cgi is a module in the standard Python library

Restricted version of Python Note: The App Engine environment includes the entire Python 2.7 standard library. – not all actions are allowed – App Engine applications run in a restricted environment that allows App Engine to scale them safely. – For example, low-level calls to the operating system, networking operations, and some filesystem operations are not allowed.

Using the Datastore Storing data in a scalable web application can be tricky! – A user could be interacting with any of dozens of web servers at a given time, and the user's next request could go to a different web server than the previous request. – All web servers need to be interacting with data that is also spread out across dozens of machines, possibly in different locations around the world! App Engine's infrastructure takes care of all of the distribution, replication, and load balancing of data behind a simple API—and you get a powerful query engine and transactions as well.

Have you HRD? App Engine's data repository, the High Replication Datastore (HRD), uses the Paxos algorithm to replicate data across multiple data centers. Data is written to the Datastore in objects known as entities. – each entity has a key that uniquely identifies it. An entity can optionally designate another entity as its parent; the first entity is a child of the parent entity. The entities in the Datastore thus form a hierarchically structured space similar to the directory structure of a file system. An entity's parent, parent's parent, and so on recursively, are its ancestors; its children, children's children, and so on, are its descendants. An entity without a parent is a root entity.

consistency… the Datastore is extremely resilient in the face of catastrophic failure, but its consistency guarantees may differ from what you're familiar with. – entities descended from a common ancestor are said to belong to the same entity group – queries over multiple entity groups may return stale, eventually consistent results, those limited to a single entity group always return up-to-date, strongly consistent results. see Structuring Data for Strong Consistency.

DS example (1)

Storing greetings For the guestbook application, we want to store greetings posted by users – Each greeting includes the author's name, the message content, and the date and time the message was posted so we can display messages in chronological order. greeting.put()

Note the URL

you%40you.com (hex ASCII!)

For the guestbook application, we want to store greetings posted by users. Each greeting includes the author's name, the message content, and the date and time the message was posted so we can display messages in chronological order from google.appengine.ext import db The following defines a data model for a greeting: class Greeting(db.Model): author = db.StringProperty() content = db.StringProperty(multiline=True) date = db.DateTimeProperty(auto_now_add=True)

Getting the greetings…