Skip to content

Instantly share code, notes, and snippets.

View dylanbstorey's full-sized avatar

Dylan Storey dylanbstorey

View GitHub Profile
@pcostesi
pcostesi / example.py
Created August 15, 2012 03:43
Flask view decorator to dispatch a request into different handlers by mimetypes.
@split
@login_required
def hello():
return render_template('hello.html')
@hello.for_mimetype("application/json")
@login_required
def hello():
return jsonify({"hello":"flask"})