flask check ip adress from device code example
Example 1: get client ip flask
request.environ['HTTP_X_FORWARDED_FOR']
Example 2: flask get ip of user
from flask import request
from flask import jsonify
@app.route("/get_my_ip", methods=["GET"])
def get_my_ip():
return jsonify({'ip': request.remote_addr}), 200