def make_url(*args, **kwargs):
    """Makes a URL from component parts"""
    base = "/".join(args)
    if kwargs:
        return "%s?%s" % (base, urlencode(kwargs))
    else:
        return base
Makes a URL from component parts