Permalink
Browse files

flask template

  • Loading branch information...
aaronsw committed Aug 28, 2012
0 parents commit d8427592d0a64398184f728e1cb6e07e48d1c3f9
Showing with 24 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +1 −0 Procfile
  3. +15 −0 app.py
  4. +1 −0 requirements.txt
  5. +1 −0 templates/index.html
@@ -0,0 +1,6 @@
+bin
+build
+include
+lib
+.Python
+*.pyc
@@ -0,0 +1 @@
+web: python app.py
15 app.py
@@ -0,0 +1,15 @@
+import os
+from flask import Flask, request, make_response, render_template
+import web
+
+app = Flask(__name__)
+app.config['DEBUG'] = bool(os.environ.get('DEBUG'))
+
+@app.route("/")
+def index():
+ name = request.form.get("name", "world")
+ return render_template("index.html", name=name)
+
+if __name__ == "__main__":
+ port = int(os.environ.get("PORT", 5000))
+ app.run(host='0.0.0.0', port=port)
@@ -0,0 +1 @@
+Flask
@@ -0,0 +1 @@
+Hello, {{name}}!

0 comments on commit d842759

Please sign in to comment.