import IP
from flask import Blueprint, request, render_template, jsonify

weather = Blueprint('weather', __name__, url_prefix='/weather')


@weather.route('/', methods=['GET'])
def index():
    ip = request.remote_addr
    location = IP.find(ip)
    return jsonify(location=location, ip=ip)

@@ -183,16 +183,140 @@
 ndex():%0A
+    if request.headers.getlist(%22X-Forwarded-For%22):%0A        ip = request.headers.getlist(%22X-Forwarded-For%22)%5B0%5D%0A    else:%0A    
     ip =
@@ -329,17 +329,17 @@
 st.remot
-e
+w
 _addr%0A  

Fix user's real ip address.