def get_current_url(): if not request.query_string: return request.path return '%s?%s' % (request.path, request.query_string)