Skip to content
Myr

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 file

Take 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 back
1from flask import jsonify
2from flask import render_template3from flask import request4

use ruff linter and formatterDavid Lordbefore adoption54e05a2

line 5why, one step back
5from . import app

reword changelog for importlib.resourcesDavid Lordbefore adoption694eb84

lines 6–7why, one step back
6
7

Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e

lines 8–9why, one step back
8@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 back
10def 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)