How to log client IP addresses?

You can access the IP address a request originates from within the corresponding callback like so:

from flask import request

@app.callback(Output('target', 'children'), [Input('input', 'value')])
def get_ip(value):
    return html.Div(request.remote_addr)
7 Likes