django.contrib.admin.util.quote doesn't seem to quote quotes (the irony...)

I think that's because most quoting functionality in django use URI quoting rules rather than URL. see also django.utils.encosing.filepath_to_uri (single quotes are legal characters in URIs)