Django helpers diary- escaping URLs
May 19th, 2007 by viestards
Have not written something in a while, was busy with one of my projects- porting Pylons webhelpers to Pylons. I didn’t know what to write, because there were no big things to write about.
Thinking of which I decided to start writing my project diary- all my problems, what I find out, hoping that others will find it useful. I decided to write at least three times a week, so this is first time.
When porting webhelpers, first problem was to create it the way that only the small part of code has to be rewritten. There is one problem thou, Pylons is using routes as their URL mapper, while Django uses regexps as URL mappers. My problem is that webhelpers escapes all apostropes because there has to be no such characters in URL! So I have a choice- rewrite parts that are responsible for urls (call to routes) or return direct value passing Template class, which is not usggested by Django team. For now I think, that best will be latter metod but just as proof of concept.