Cloud computing lectures: Programming with Google App Engine Keke Chen.

Slides:



Advertisements
Similar presentations
Adding Dynamic Content to your Web Site
Advertisements

Web Basics Willem Visser RW334. Overview Basic Browser and Server Interaction – Forms with actions, url encoding and handlers – Parameters – Having more.
Server-Side vs. Client-Side Scripting Languages
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
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.
Multiple Tiers in Action
Python and Web Programming
Definitions, Definitions, Definitions Lead to Understanding.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
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.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
1 ‘Dynamic’ Web Pages So far, we have developed ‘static’ web-pages, e.g., cv.html, repair.html and order.html. There is often a requirement to produce.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Googe App Engine Codelab Marzia Niccolai May 28-29, 2008.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Cloud Operating System Unit 11 Sever Technology II M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014.
from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer httpd = SocketServer.TCPServer((‘’, 8000), SimpleHTTPRequestHandler) httpd.serve_forever()
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
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.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
CSU - DCE Advanced Perl CGI Operation - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) on the.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Chapter 6 Server-side Programming: Java Servlets
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Developing QueryContent for IBIS-PH. Let’s check a few things. 1.Do you have a “Q:\” drive mapped to the backend ibis-q server?
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
Google App Engine Data Store ae-10-datastore
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
Google Application Engine Introduction Jim Eng with thanks to Charles Severance
App Engine Web App Framework Jim Eng
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Implementing The Middle Tier These slides.
Saving State on the WWW. The Issue  Connections on the WWW are stateless  Every time a link is followed is like the first time to the server — it has.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
Caching Willem Visser RW334. Overview AppEngine Datastore No Caching Naïve Caching Caching invalidation Cache updating Memcached Beyond your code.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
1 HTML forms (cont.)
CS2021- Week 10 – Models and Views Web Development Model, Views, Controller Templates Databases.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Google App Engine Mano Marks Developer Advocate. Problems building web applications Why Google App Engine? The App Engine Components What’s Next Questions?
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
Google App Engine An Example!. Schedule Today: AppEngine and Python Wednesday: Review and CES! Friday Quiz!!! Next week: – DEMO MADNESS!!! – Approx 20.
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Python Web Development
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
Testing REST IPA using POSTMAN
Google App Engine Ying Zou 01/24/2016.
Module P3 Practical: Building a webapp in nodejs and
Presentation transcript:

Cloud computing lectures: Programming with Google App Engine Keke Chen

Outline Using google app engine - walk through a simple example

Background: how cgi works Request : content/url sent by the client Response: content return to the client’s browser 3 Client server Request: request a url, click a button, etc Request a url: “get” url Response: CGI returns some html code Click buttons: “post” something

Python “hello world” CGI program helloworld.py print 'Content-Type: text/plain' print '' print 'Hello, world!'

Preparation Have your gmail account Installing google apps tool – dev_appserver.py, the development web server dev_appserver.py – appcfg.py, for uploading your app to App Engine appcfg.py

Setup the development env Windows/mac: check s.html to find the package s.html Nimbus17: already installed at /usr/local/gae

Webapp does Wraps the CGI functions – API for handling request/response Python Web Server Gateway Interface (WSGI) – A framework for developing CGI programs with Python 7

from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!') application = webapp.WSGIApplication( [('/', MainPage)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main()

Configuration file app.yaml – A standard file format for configuration – A set of API designed to access the configuration – – Don’t need to know much about yaml – Check GAE’s typical configurations 9

App.yaml application: helloworld version: 1 runtime: python27 threadsafe: false api_version: 1 handlers: - url: /.* script: helloworld.py If threadsafe is set to true, use helloworld.application

Start development server How to start /usr/local/gae/dev_appserver.py helloworld/ -p port -a address

Use users service Use the google account service 12

Using users service user = users.get_current_user() if user: self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, ' + user.nickname()) else: self.redirect(users.create_login_url(self.request.uri))

Handling forms with webapp self.response.out.write(""" """)

db - datastore db.Model GQL: sql like query language greetings = db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10") Or omit select *: greetings = Greeting.gql("ORDER BY date DESC LIMIT 10") With parameters: greetings = Greeting.gql("WHERE author = :1 ORDER BY date DESC",users.get_current_user()) greetings = Greeting.all() greetings.filter("author =", users.get_current_user()) greetings.order("-date") 16

Entity group Passing parameters

Use templates Templates are used to generate the similar webpages with different variables 19

Use stylesheet Change app.yaml Include the code for using stylesheet

Upload application Create an application at Google AppEngine Change the app name in app.yaml correspondingly Run appcfg.py update helloworld/