# -*- coding: utf-8 -*- #from quixote import enable_ptl #enable_ptl() from quixote.publish import Publisher from quixote.directory import Directory from quixote.form import Form, StringWidget from quixote.server import simple_server from quixote import get_response def create_publisher(): return Publisher(RootDirectory(), display_exceptions='plain') class RootDirectory(Directory): _q_exports = [""] def _q_index(self): get_response().set_charset('utf-8') form = Form() form.add(StringWidget, "name", title="Your Name", size=20, required=True) form.add(StringWidget, "email", title="Email address", size=20, required=True) form.add_submit("go", "Go!") return form.render() simple_server.run(create_publisher, host="127.0.0.1", port=8080)