WSGI Class

Configuration

The WSGI class contains several configuration properties for use in your app subclass.

class app(pycnic.core.WSGI):

    # logger: A Python logging Logger instance
    logger = logging.Logger(__name__)

    # before: A function that accepts a WSGI instance 
    # as its first argument. Does not need to return. 
    before = None

    # after: A function that accepts a WSGI instance
    # as its first argument. Does not need to return.
    after = None

    # debug: Boolean. If true, will return error stacktraces
    # for uncaught exceptions and json will be pretty-formatted.
    debug = False

    # strip_path: Boolean. If true, paths with a trailing 
    # slash (/foo/bar/) will have the trailing slash removed 
    # (/foo/bar) before routing the request
    strip_path = True

    # routes: A list of (path, Handler()) tuples.
    routes = []