I’m not using regular model, so can’t use Django’s syndication framework. So, i did used the low-level syndication util called feedgenerator to generate RSS feeds like shown below.
feed = feedgenerator.Rss201rev2Feed(title=_("Feed by %s") % user.username,
link="http://%s" % DOMAIN_NAME,
description=_("RSS Feed provided by something.com"),
language=user.language,
author_name=user.full_name,
feed_url="something")
for note in ObjectModel.published_objects.filter(user=user):
feed.add_item(title=note.title,
link="",
pubDate=note.created,
description=note.note)
response = HttpResponse(feed.writeString('UTF-8'), mimetype='application/rss+xml')
return response
However, I couldn’t find good example how i can return this as Response type.
response = HttpResponse(feed.writeString('UTF-8'), mimetype='application/rss+xml')
Apparently, Above code seems not right cause the browser does not recognizes as RSS feed. Could someone tell me what I should do to fix this problem?
This is just working fine. Was recognizable by browser.