Skip to content

Instantly share code, notes, and snippets.

View abulte's full-sized avatar

Alexandre Bulté abulte

View GitHub Profile
@abulte
abulte / forms.html
Last active December 15, 2015 13:08 — forked from gnunicorn/forms.html
Jinja2 macros for TW Bootstrap, updated to work with 2.3.
<!-- https://gist.github.com/abulte/5264753 -->
{%- macro form_field_label(field) -%}
<label class="control-label" for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Required"> *</abbr>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_help(help) -%}
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')