Код: Выделить всё
from fastapi import FastAPI
app = FastAPI()
@app.get('/hello/')
def hello_world():
return {"msg": "Hello World"}
@app.get('/hello/{number}/')
def hello_world_number(number: int):
return {"msg": "Hello World Number", "number": number}
- Flask: [/b]
Код: Выделить всё
url_for(...) - Джанго: [/b]
Код: Выделить всё
reverse(...)
Подробнее здесь: https://stackoverflow.com/questions/636 ... route-name
Мобильная версия