Django Syndication with Colddirt
Creating feeds in Django is freaking simple. I’ll start with an example of just updating a feed with the newest objects (for instace, newest blog posts). Similar to the forms.py way of handling our different forms, I’ve created a feeds.py to handle the feeds.
from django.contrib.syndication.feeds import Feed from colddirt.dirty.models import Dirt class LatestDirts(Feed): title = "Cold Dirt" link = "/" description = "When you have dirt, you've got dirt. Right..." copyright = 'All Rights Unreserved' def items(self): return Dirt.objects.all()[:50] What this will do is query our Dirt DB and return an obj. The fields here are pretty well documented in the Django docs, …
Read more