get_real_ip and city_ip should be after the 'if request.method == post'