$ 0 0 There is not as middlewares are operating on the WSGI layer. You can however let the middleware perform some basic path checks.