wsgi-dev.py
author Tero Marttila <terom@fixme.fi>
Tue, 25 Jan 2011 01:28:06 +0200
changeset 32 47e977c23ba2
parent 22 809686edcd4c
permissions -rwxr-xr-x
implement rendering of pmacct rrd graphs, and a dir/top.png feature
#!/usr/bin/env python
"""
    Simple test server/environment for WSGI development
"""

import werkzeug

from rrdweb import wsgi, graph

import logging


if __name__ == '__main__' :
    logging.basicConfig(format="[%(levelname)5s] %(funcName)25s : %(message)s", level=logging.DEBUG)

    app = wsgi.WSGIApp(
            rrdpath     = 'var/rrd',
            tplpath     = 'etc/templates',
            imgpath     = 'var/img',

            rrdgraph    = graph.pmacct_data,
    )

    # run
    werkzeug.run_simple('localhost', 8081, app, use_reloader=True, use_debugger=True, 
            static_files    = {
                '/static':  'static/',
            },
    )