views.py
This file
Path
examples/javascript/js_example/views.py
18 lines · 429 bytes · Python
Last changed by
use ruff linter and formatterDavid Lordbefore adoption54e05a2
History of this fileTake it
The walk stopped after 200 commits: lines older than 694eb84 point at it.
reword changelog for importlib.resourcesDavid Lordbefore adoption694eb84
lines 1–4why, one step back1from flask import jsonify2from flask import render_template3from flask import request4use ruff linter and formatterDavid Lordbefore adoption54e05a2
line 5why, one step back5from . import appreword changelog for importlib.resourcesDavid Lordbefore adoption694eb84
lines 6–7why, one step back67Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e
lines 8–9why, one step back8@app.route("/", defaults={"js": "fetch"})9@app.route("/<any(xhr, jquery, fetch):js>")reword changelog for importlib.resourcesDavid Lordbefore adoption694eb84
lines 10–18why, one step back10def index(js):11 return render_template(f"{js}.html", js=js)121314@app.route("/add", methods=["POST"])15def add():16 a = request.form.get("a", 0, type=float)17 b = request.form.get("b", 0, type=float)18 return jsonify(result=a + b)