from werkzeug import BaseRequest, BaseResponse, ETagResponseMixin, escape, run_simple, SharedDataMiddleware from werkzeug.exceptions import HTTPException import os import sha from time import time from random import choice class Request(BaseRequest): """Useful subclass of the default request that knows how to build urls.""" def __init__(self, environ): BaseRequest.__init__(self, environ) class Response(BaseResponse, ETagResponseMixin): """Subclass of base response that has a default mimetype of text/html.""" default_mimetype = 'text/html' def app(environ, start_response): """The WSGI application that connects all together.""" req = Request(environ) path = req.path[1:].lower() if path == '': # page page = u'