A Really Basic, Low-Level App Engine Program

This program dumps stuff out – it shows you the reason why you want to use

from google.appengine.ext import webapp

This is looks at the Google App Engine at its most basic CGI. Here is some really awesome CGI documentation from the early days:

http://hoohoo.ncsa.uiuc.edu/cgi/in.html

import os
import sys
# Print a form for testing of POST
print 'Content-Type: text/html'
print ''
print '<form method="post" action="/">'
print 'Zap Data: <input type="text" name="zap"><br>'
print 'Zot Data: <input type="zot" name="zap"><br>'
print '<input type="submit">'
print "</form>"
# Dump raw CGI
# http://hoohoo.ncsa.uiuc.edu/cgi/in.html
print "<pre>"
print 'Environment keys:'
print ''
for param in os.environ.keys():
print "%20s %s" % (param,os.environ[param])
print ''
# Dump the GCI data
print 'Data'
count = 0
for l in sys.stdin:
count = count + 1
print l
if count > 100:
break
print "</pre>"
# In case you want to test file uploading
# print '<form method="post" action="/" enctype="multipart/form-data">'
# print 'File Data: <input type="file" name="filedat"><br>'