What is the best way to embed HTML in an RSS feed?

可紊 提交于 2019-11-30 20:27:24

When I run into issues like this with Django my first instinct is to run off and find a normal Python lib that does what I want. In this case PyRSS2Gen might be your saviour.

It'll probably require a bit more fannying around (because it'll be unaware of what Django objects are) but it should be raw enough to let you do as you wish.

And if it isn't, it's just a script. You can hack it apart to allow raw HTML if you please =)

Instead of writing your own RSS XML feed, consider using the Django syndication framework from django.contrib.syndication:

https://docs.djangoproject.com/en/dev/ref/contrib/syndication/

Embedding HTML is CDATA has troubled me in the past. Hope RSS readers have evolved to handle such embeds.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!