from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer httpd = SocketServer.TCPServer((‘’, 8000), SimpleHTTPRequestHandler) httpd.serve_forever()

Slides:



Advertisements
Similar presentations
Adding Dynamic Content to your Web Site
Advertisements

1 CGICGI Common Gateway Interface Server-side Programming Lecture.
Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
Vending Machine FSM Benjamin Welton 03/20/2010 CS 480.
How the web works: HTTP and CGI explained
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Hello Vaadin! CS 3130 Summer 2015.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Platform as a Service (PaaS)
Python Programming Language. Created in 1991 by Guido Van Rossum.
“I drink my WSGI clear” A barebones introduction to Python Web Programming. 3/14/2011.
UNIT-V The MVC architecture and Struts Framework.
TOPIC 1 – SERVER SIDE APPLICATIONS IFS 234 – SERVER SIDE APPLICATION DEVELOPMENT.
Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server.
Introduction Servlets and JSP Celsina Bignoli
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
Basics of the HTTP Protocol and Apache Web Server Brandon Checketts.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
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.
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 computing lectures: Programming with Google App Engine Keke Chen.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014.
Tcl/2k Conference, slide 1 TclHttpd The Tcl Web Server Brent Welch ftp.scriptics.com/pub/tcl/httpd.
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.
WWW Forms and Search. Forms URL - always fetch a particular page What if the information we want varies from time to time and from user to user?
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Who uses it? MichaelMoore.com What's it all about? Rapid Development Clean, Pragmatic Design.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Templates, Databases and Frameworks. Databases: DBI Common database interface for perl Provides a functional,
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
First Indico Workshop WEB FRAMEWORKS Adrian Mönnich May 2013 CERN.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
COWS CEDA OGC Web Services Framework Stephen Pascoe.
Google Application Engine Introduction Jim Eng with thanks to Charles Severance
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Martin Kruliš by Martin Kruliš (v1.1)1.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
 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.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Web Server Apache PHP HTTP Request User types URL into browser Address resolved if nec. We use directly Most browsers request.
Chapter 16 Web Pages And CGI Scripts Department of Biomedical Informatics University of Pittsburgh School of Medicine
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Ext JS HTML docs Ext JS HTML docs Parser (ExtToPascal.dpr) Parser (ExtToPascal.dpr) Wrapper 12 units (Ext, ExtGlobal, ExtData, ExtUtil,ExtForm,ExtGrid,etc)
9/21/04 James Gallagher Server-Side: The Basics This part of the workshop contains an overview of the two servers which OPeNDAP has developed. One uses.
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)
APIs George Wyner January 28, Agenda What is an API? How do developers discover, understand, and use APIs to build applications How to use an API.
J2EE vs Python for web development David
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Platform as a Service (PaaS)
Play Framework: Introduction
Development and Deployment with WSGI in Django
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.
بسم الله الرحمن الرحیم.
UNH Programming Assistance Center Automation
Google App Engine Ying Zou 01/24/2016.
Flask Web Frameworks for Python
Lecture 10: The Web Server Wednesday February 14, /10/2019
Presentation transcript:

from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer httpd = SocketServer.TCPServer((‘’, 8000), SimpleHTTPRequestHandler) httpd.serve_forever()

 CGI: Common Gateway Interface ◦ need to start a new process for every request  not recommened ◦ cgi, cgitb module  FastCGI, SCGI(a simpler FastCGI) ◦ uses preforked backgroundprocesses to handle requests  by imbedding interpreters into the web server CGI

 A standard interface between web server and web applications written in Python  WSGI application will work on any gateway interfaces: CGI, FastCGI, SCGI, mod_python, or mod_wsgi  mod_wsgi: a WSGI server in Apache web server (WCGI-compliant) ◦ embedded mode (integrated with Apache process) ◦ daemon mode which is FastCGI-like  wsgiref module ◦ A reference implementation of WSGI specification ◦ contains a small web server that can be used for testing

#!/usr/bin/env python from wsgiref.simple_server import make_server def application(environ, start_response): response_body = 'Hello, world!' status = '200 OK' response_headers = [('Content-Type', 'text/plain')] start_response(status, response_headers) return [response_body] # for testing only server = make_server('localhost', 8051, application) server.serve_forever()  Publishing ◦ upload this program to web server directory (after removing main statements) ◦ lo.py  Testing ◦ Run this program by lauching test server ◦ Enter URL on the browser   or hello.py:

 MVC ◦ model: data to be displayed and modified ◦ view: display the data of the model to the user  typically implemented by templates ◦ controller  reacts to user actions  tells the model to modify the data, and tells the view code what to display  Frameworks for web app development in Python ◦ Django:  Google App Engine: a PaaS ◦