开发者

Django - Twitter URLs with hash bangs get broken when escaped

Django 开发者_如何转开发 escapes Twitter URLS in a way that Twitter doesn't like: for example http://twitter.com/#!/bugspy becomes http://twitter.com/#%21%2Fbugspy

And twitter won't serve it. How this can be fixed (without explicitly in the code replacing the %21%2F with !/) ?


What version of django are you using? In django 1.3 it works fine.

>>> from django.template.defaultfilters import urlize
>>> urlize('http://twitter.com/#!/bugspy')
u'<a href="http://twitter.com/#%21/bugspy" rel="nofollow">http://twitter.com/#!/bugspy</a> '

And this url work fine on twitter. Also you can look at this snipept : http://djangosnippets.org/snippets/1445/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜