Permalink
Browse files

First commit.

  • Loading branch information...
0 parents commit 664b54e252b6c420c4ca41e7c2fbed6cac115540 @zachwill committed Mar 11, 2011
Showing with 43,652 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +30 −0 README.md
  3. +37 −0 app.py
  4. +35 −0 app.yaml
  5. +13 −0 bootstrap.py
  6. +34 −0 libs/flask/__init__.py
  7. +889 −0 libs/flask/app.py
  8. +152 −0 libs/flask/config.py
  9. +66 −0 libs/flask/ctx.py
  10. +20 −0 libs/flask/globals.py
  11. +473 −0 libs/flask/helpers.py
  12. +42 −0 libs/flask/logging.py
  13. +222 −0 libs/flask/module.py
  14. +43 −0 libs/flask/session.py
  15. +50 −0 libs/flask/signals.py
  16. +100 −0 libs/flask/templating.py
  17. +45 −0 libs/flask/testing.py
  18. +88 −0 libs/flask/wrappers.py
  19. +73 −0 libs/jinja2/__init__.py
  20. +78 −0 libs/jinja2/_debugsupport.c
  21. +225 −0 libs/jinja2/_markupsafe/__init__.py
  22. +49 −0 libs/jinja2/_markupsafe/_bundle.py
  23. +267 −0 libs/jinja2/_markupsafe/_constants.py
  24. +45 −0 libs/jinja2/_markupsafe/_native.py
  25. +80 −0 libs/jinja2/_markupsafe/tests.py
  26. +130 −0 libs/jinja2/_stringdefs.py
  27. +280 −0 libs/jinja2/bccache.py
  28. +1,640 −0 libs/jinja2/compiler.py
  29. +32 −0 libs/jinja2/constants.py
  30. +308 −0 libs/jinja2/debug.py
  31. +40 −0 libs/jinja2/defaults.py
  32. +1,118 −0 libs/jinja2/environment.py
  33. +143 −0 libs/jinja2/exceptions.py
  34. +610 −0 libs/jinja2/ext.py
  35. +719 −0 libs/jinja2/filters.py
  36. +681 −0 libs/jinja2/lexer.py
  37. +449 −0 libs/jinja2/loaders.py
  38. +102 −0 libs/jinja2/meta.py
  39. +901 −0 libs/jinja2/nodes.py
  40. +68 −0 libs/jinja2/optimizer.py
  41. +896 −0 libs/jinja2/parser.py
  42. +544 −0 libs/jinja2/runtime.py
  43. +271 −0 libs/jinja2/sandbox.py
  44. +146 −0 libs/jinja2/tests.py
  45. +95 −0 libs/jinja2/testsuite/__init__.py
  46. +240 −0 libs/jinja2/testsuite/api.py
  47. +286 −0 libs/jinja2/testsuite/core_tags.py
  48. +60 −0 libs/jinja2/testsuite/debug.py
  49. +29 −0 libs/jinja2/testsuite/doctests.py
  50. +455 −0 libs/jinja2/testsuite/ext.py
  51. +291 −0 libs/jinja2/testsuite/filters.py
  52. +144 −0 libs/jinja2/testsuite/imports.py
  53. +208 −0 libs/jinja2/testsuite/inheritance.py
  54. +390 −0 libs/jinja2/testsuite/lexnparse.py
  55. +191 −0 libs/jinja2/testsuite/loader.py
  56. +258 −0 libs/jinja2/testsuite/regression.py
  57. 0 libs/jinja2/testsuite/res/__init__.py
  58. +3 −0 libs/jinja2/testsuite/res/templates/broken.html
  59. +1 −0 libs/jinja2/testsuite/res/templates/foo/test.html
  60. +4 −0 libs/jinja2/testsuite/res/templates/syntaxerror.html
  61. +1 −0 libs/jinja2/testsuite/res/templates/test.html
  62. +134 −0 libs/jinja2/testsuite/security.py
  63. +87 −0 libs/jinja2/testsuite/tests.py
  64. +85 −0 libs/jinja2/testsuite/utils.py
  65. +601 −0 libs/jinja2/utils.py
  66. +87 −0 libs/jinja2/visitor.py
  67. +157 −0 libs/werkzeug/__init__.py
  68. +398 −0 libs/werkzeug/_internal.py
  69. +16 −0 libs/werkzeug/contrib/__init__.py
  70. +343 −0 libs/werkzeug/contrib/atom.py
  71. +511 −0 libs/werkzeug/contrib/cache.py
  72. +205 −0 libs/werkzeug/contrib/fixers.py
  73. +281 −0 libs/werkzeug/contrib/iterio.py
  74. +258 −0 libs/werkzeug/contrib/jsrouting.py
  75. +284 −0 libs/werkzeug/contrib/kickstart.py
  76. +36 −0 libs/werkzeug/contrib/limiter.py
  77. +331 −0 libs/werkzeug/contrib/lint.py
  78. +116 −0 libs/werkzeug/contrib/profiler.py
  79. +328 −0 libs/werkzeug/contrib/securecookie.py
  80. +342 −0 libs/werkzeug/contrib/sessions.py
  81. +66 −0 libs/werkzeug/contrib/testtools.py
  82. +275 −0 libs/werkzeug/contrib/wrappers.py
  83. +2,331 −0 libs/werkzeug/datastructures.py
  84. +166 −0 libs/werkzeug/debug/__init__.py
  85. +201 −0 libs/werkzeug/debug/console.py
  86. +103 −0 libs/werkzeug/debug/render.py
  87. +238 −0 libs/werkzeug/debug/repr.py
  88. +81 −0 libs/werkzeug/debug/shared/body.tmpl
  89. +8 −0 libs/werkzeug/debug/shared/codetable.tmpl
  90. BIN libs/werkzeug/debug/shared/console.png
  91. +196 −0 libs/werkzeug/debug/shared/debugger.js
  92. +19 −0 libs/werkzeug/debug/shared/jquery.js
  93. BIN libs/werkzeug/debug/shared/less.png
  94. BIN libs/werkzeug/debug/shared/more.png
  95. BIN libs/werkzeug/debug/shared/source.png
  96. +93 −0 libs/werkzeug/debug/shared/style.css
  97. +16 −0 libs/werkzeug/debug/shared/vartable.tmpl
  98. +297 −0 libs/werkzeug/debug/tbtools.py
  99. +28 −0 libs/werkzeug/debug/templates/console.html
  100. +14 −0 libs/werkzeug/debug/templates/dump_object.html
  101. +6 −0 libs/werkzeug/debug/templates/frame.html
  102. +10 −0 libs/werkzeug/debug/templates/help_command.html
  103. +8 −0 libs/werkzeug/debug/templates/source.html
  104. +55 −0 libs/werkzeug/debug/templates/traceback_full.html
  105. +6 −0 libs/werkzeug/debug/templates/traceback_plaintext.html
  106. +23 −0 libs/werkzeug/debug/templates/traceback_summary.html
  107. +20 −0 libs/werkzeug/debug/utils.py
  108. +459 −0 libs/werkzeug/exceptions.py
  109. +352 −0 libs/werkzeug/formparser.py
  110. +578 −0 libs/werkzeug/http.py
  111. +405 −0 libs/werkzeug/local.py
  112. +104 −0 libs/werkzeug/posixemulation.py
  113. +1,434 −0 libs/werkzeug/routing.py
  114. +303 −0 libs/werkzeug/script.py
  115. +104 −0 libs/werkzeug/security.py
  116. +533 −0 libs/werkzeug/serving.py
  117. +392 −0 libs/werkzeug/templates.py
  118. +808 −0 libs/werkzeug/test.py
  119. +214 −0 libs/werkzeug/testapp.py
  120. +456 −0 libs/werkzeug/urls.py
  121. +185 −0 libs/werkzeug/useragents.py
  122. +674 −0 libs/werkzeug/utils.py
  123. +1,495 −0 libs/werkzeug/wrappers.py
  124. +764 −0 libs/werkzeug/wsgi.py
  125. +7 −0 models.py
  126. +8 −0 static/css/handheld.css
  127. +261 −0 static/css/style.css
  128. +261 −0 static/css/style.less
  129. +43 −0 static/humans.txt
  130. +2 −0 static/img/.gitignore
  131. BIN static/img/apple-touch-icon-114x114-precomposed.png
  132. BIN static/img/apple-touch-icon-57x57-precomposed.png
  133. BIN static/img/apple-touch-icon-72x72-precomposed.png
  134. BIN static/img/apple-touch-icon-precomposed.png
  135. BIN static/img/apple-touch-icon.png
  136. BIN static/img/favicon.ico
  137. +13 −0 static/js/libs/dd_belatedpng.js
  138. +8,316 −0 static/js/libs/jquery-1.5.1.js
  139. +16 −0 static/js/libs/jquery-1.5.1.min.js
  140. +2 −0 static/js/libs/modernizr-1.7.min.js
  141. +2 −0 static/js/mylibs/.gitignore
  142. +15 −0 static/js/plugins.js
  143. +26 −0 static/js/script.js
  144. +5 −0 static/robots.txt
  145. +31 −0 static/test/index.html
  146. +148 −0 static/test/qunit/qunit.css
  147. +1,265 −0 static/test/qunit/qunit.js
  148. +27 −0 static/test/tests.js
  149. +26 −0 templates/404.html
  150. +73 −0 templates/base.html
  151. +28 −0 templates/index.html
  152. +65 −0 templates/todo.html
@@ -0,0 +1,2 @@
+index.yaml
+*.pyc
@@ -0,0 +1,30 @@
+gae-flask-html5
+===============
+
+# What is this?
+
+Just a simple Flask skeleton for Google App Engine, but made with all the
+baked-in-goodness of html5 boilerplate.
+
+I'm planning on using this for my projects going forward (really like the
+speed of Flask compared to Django-Nonrel on GAE), so I thought someone
+else might find it useful, too.
+
+Also, I included a style.less file since I primarily only use the Less app
+(http://incident57.com/less/) when writing stylesheets nowadays.
+
+
+Setup
+------
+
+ git clone https://github.com/zachwill/gae-flask-html5.git <your_app_name>
+
+Run
+------
+
+ dev_appserver.py .
+
+Deploy
+------
+
+ appcfg.py update .
37 app.py
@@ -0,0 +1,37 @@
+#
+# Flask Documentation: http://flask.pocoo.org/docs/
+# Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
+# Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
+# The Python Datastore API: http://code.google.com/appengine/docs/python/datastore/
+#
+
+from flask import Flask, url_for, render_template, request, redirect
+from models import Todo
+
+app = Flask(__name__)
+
+
+@app.route('/')
+def index():
+ """Render our website's index page."""
+ return render_template('index.html')
+
+
+@app.route('/todo/')
+def todo_list():
+ """Simple todo page."""
+ return render_template('todo.html', todos=Todo.all().order('-created_at'))
+
+
+@app.route('/todo/add', methods=["POST"])
+def add_todo():
+ """Add a todo."""
+ todo = Todo(text=request.form['text'])
+ todo.save()
+ return redirect(url_for('todo_list'))
+
+
+@app.errorhandler(404)
+def page_not_found(e):
+ """Custom 404 page."""
+ return render_template('404.html'), 404
@@ -0,0 +1,35 @@
+application: your-app-name-here
+version: 1
+runtime: python
+api_version: 1
+
+
+builtins:
+- appstats: on
+- remote_api: on
+- datastore_admin: on
+
+
+handlers:
+
+- url: /favicon.ico
+ static_files: static/img/favicon.ico
+ upload: static/img/favicon.ico
+
+- url: /apple-touch-icon.png
+ static_files: static/img/apple-touch-icon.png
+ upload: static/img/apple-touch-icon.png
+
+- url: /robots.txt
+ static_files: static/robots.txt
+ upload: static/robots.txt
+
+- url: /humans.txt
+ static_files: static/humans.txt
+ upload: static/humans.txt
+
+- url: /static
+ static_dir: static
+
+- url: /.*
+ script: bootstrap.py
@@ -0,0 +1,13 @@
+import sys
+import os
+
+# Let's keep flask, jinja2, and werkzeug in a separate libs folder.
+# NOTE: You can add other libraries here, too -- and still
+# import them as normal.
+
+ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, os.path.join(ROOT_DIR, 'libs'))
+
+from wsgiref.handlers import CGIHandler
+from app import app
+CGIHandler().run(app)
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+"""
+ flask
+ ~~~~~
+
+ A microframework based on Werkzeug. It's extensively documented
+ and follows best practice patterns.
+
+ :copyright: (c) 2010 by Armin Ronacher.
+ :license: BSD, see LICENSE for more details.
+"""
+
+# utilities we import from Werkzeug and Jinja2 that are unused
+# in the module but are exported as public interface.
+from werkzeug import abort, redirect
+from jinja2 import Markup, escape
+
+from .app import Flask, Request, Response
+from .config import Config
+from .helpers import url_for, jsonify, json_available, flash, \
+ send_file, send_from_directory, get_flashed_messages, \
+ get_template_attribute, make_response
+from .globals import current_app, g, request, session, _request_ctx_stack
+from .module import Module
+from .templating import render_template, render_template_string
+from .session import Session
+
+# the signals
+from .signals import signals_available, template_rendered, request_started, \
+ request_finished, got_request_exception
+
+# only import json if it's available
+if json_available:
+ from .helpers import json
Oops, something went wrong.

0 comments on commit 664b54e

Please sign in to comment.