Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- import cherrypy
- import os.path
- import json
- from mako.template import Template
- from mako.lookup import TemplateLookup
- lookup = TemplateLookup(directories=['content'])
- class Root:
- @cherrypy.expose
- def index(self):
- tmpl = lookup.get_template("index.html")
- return tmpl.render(**dict(username="Welcome"))
- #--------------------------------------
- class Application_cl(object):
- #--------------------------------------
- #----------------------------------
- def __init__(self):
- #--------------------------------------
- # constructor
- pass
- #--------------------------------------
- def default(self, *arglist, **kwargs):
- #--------------------------------------
- msg_s = "unbekannte Anforderung: " + \
- str(arglist) + \
- ' ' + \
- str(kwargs)
- raise cherrypy.HTTPError(404, msg_s)
- default.exposed = True
- # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement