Reputation: 619
I'm attempting to URL encode a string that contains slashes in Django 1.3 using the optional argument shown in the docs:
{{ someString|urlencode:"" }}
However, the slashes aren't getting URL encoded, they're left intact. So, if someString is "A/V Equipment", I'm getting "A/V%20Equipment". What am I doing wrong?
Upvotes: 3
Views: 5249
Reputation: 15
"/" is already a valid url character and as such will not be encoded to something else. You are not doing anything wrong. I take it you are having issues with some sort of clean url argument that gets confused with the / character? If this is the case, rather pass the string in as a query parameter.
Upvotes: 1