liste blanche IP Sanic
whitelist = ["127.0.0.1"]
@app.on_request
async def on_request(request):
user_ip = request.remote_addr or request.ip
if (not user_ip in whitelist):
return text("Nice try", status=403) # 403 = forbidden
# no need to write an else; the requested method will run.
Supreme Oreo