#!/usr/local/bin/python2.6 import os, sys, datetime from flask import Flask, render_template import actorNames2 app = Flask(__name__) @app.route('/') def welcome(): output = ('
using Python '+sys.version + '\n
the time is '+datetime.datetime.now().ctime() + '\n
Go here for a list of actors' ) return output @app.route('/actors') def overview(): dsn = actorNames2.get_dsn() conn = actorNames2.getConn(dsn) info = actorNames2.getNames(conn) return render_template('list.html', desc='Actors and their birthdates', array=info) 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)