django-cas-server/cas_server/utils.py

10 lines
266 B
Python

import urlparse
import urllib
def update_url(url, params):
url_parts = list(urlparse.urlparse(url))
query = dict(urlparse.parse_qsl(url_parts[4]))
query.update(params)
url_parts[4] = urllib.urlencode(query)
return urlparse.urlunparse(url_parts)