Since we import url_parse above, you should simply use urlparse.parse_qsl I think