summaryrefslogtreecommitdiff
path: root/web/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'web/main.py')
-rwxr-xr-xweb/main.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/web/main.py b/web/main.py
new file mode 100755
index 0000000..b7501c5
--- /dev/null
+++ b/web/main.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python2.6
+
+from flask import Flask
+
+from with_xml import Node
+
+app = Flask(__name__)
+
+@app.route('/')
+def index():
+ content = Node()
+ tag = content.tag
+ put = content.put
+ a = tag('a')
+ with tag('html'):
+ with tag('head'):
+ with tag('title'):
+ put('Title')
+ with tag('body'):
+ with tag('h1'):
+ put('Header')
+ put('This is ')
+ with a(href='http://google.com/'):
+ put('a link to Google.')
+ return str(content)
+
+if __name__ == '__main__':
+ app.run(debug=True)