http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe
http://docs.djangoproject.com/en/dev/topics/templates/#id2
--
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
Get off the sidelines and huddle up with the Statesman all season long
for complete high school, college and pro coverage in print and online!
In terms of having the browser's user see the plus signs in the location
bar, there is no way to do that, because of their interpretation
described above.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Sorry, Julian, I misunderstood what you wrote. I see the Django HTML
escaping doesn't change the '+' symbol, which makes this even more
confusing... Even more strangely, this only happens intermittently.
Karen, you were exactly right: APPEND_SLASH is the culprit here. If
you hit '/search/hotel+air/', the address stays that way. Hitting '/
search/hotel+air' though redirects you to '/search/hotel%2Bair/'
I am using '+' because it logically makes sense for what I am trying
to do. I am doing a travel search, and for packages it would be
something like '/search/hotel+air/'. You can append any number of
travel pieces in there like '/search/cruise+hotel+car+air/'. The order
of the pieces doesn't matter, because I split them on '+' when it gets
to the view.
Even if '+' is meant to be a space in URL-speak, it conveys the right
meaning for what I am trying to do. Is it possible to prevent
APPEND_SLASH from percent encoding URLs?
The problem is it looks bad! It makes the URL unreadable, which is
what I want to prevent. For example, last.fm uses '+' symbols to
separate band names.
http://www.last.fm/music/Goo+Goo+Dolls pretty obviously takes you to
the page for the band "Goo Goo Dolls".
http://www.last.fm/music/Goo%2BGoo%2BDolls, however, is far tougher to
pick apart by a human reader.
My short answer is I want to keep my URLs human readable.
The URL encoding is not causing any problems in my code. Splitting the
parameter on '+' works the same whether the address is 'Goo+Goo+Dolls'
or 'Goo%2BGoo%2BDolls'.
I can certainly add additional expressions to catch URLs with and
without the trailing slash, I was just hoping there was an option to
do just that.