Skip to content

Middleware File ( middleware.x.py)

Sarthak Ghoshal edited this page Nov 8, 2025 · 1 revision

+middleware.x.py File

this file runs before every NEW request to a url it takes in a parameter that contains the route's information

def middleware(route):
  print(route.Name)

difference between +middleware.x.py and .api.x.py:

  • +middleware.x.py file runs before every new url request, no need to call it
  • api.x.py files run upon requesting it manually, but are more power full, containing more tools to work with

Clone this wiki locally