Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (21 sloc) 0.659 kB
# -*- coding: utf-8 -*-
jQuery Example
A simple application that shows how Flask and jQuery get along.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
def add_numbers():
"""Add two numbers server side, ridiculous but well..."""
a = request.args.get('a', 0, type=int)
b = request.args.get('b', 0, type=int)
return jsonify(result=a + b)
def index():
return render_template('index.html')
if __name__ == '__main__':
Jump to Line
Something went wrong with that request. Please try again.