#!/usr/local/bin/python2.6 import os, sys, datetime from flask import Flask, render_template app = Flask(__name__) numRequests = 0 @app.route('/') def welcome(): global numRequests numRequests += 1 output = ('
using Python '+sys.version + '\n
the time is '+datetime.datetime.now().ctime() + '\n
this is request '+str(numRequests) ) return output @app.route('/hello') def hello(): return 'This is how we say hello!' @app.route('/bye') def bye(): return 'This is how we say good-bye!!' @app.route('/overview') def overview(): return render_template('reading.html', title='All Topics', classdate='Feb 32nd, 2017', article='The following lists all the readings for the semester') if __name__ == '__main__': app.debug = True port = os.getuid() # Flask will print the port anyhow, but let's do so too print('Running on port '+str(port)) app.run('0.0.0.0',port)