I am trying to build a custom generated RSS feed using django's built in Syndication Framework. I am using mongoengine to interface django with mongoDB.
I am storing a set of documents that have a list of tags attached to each document. It is modeled as the following:
class Request(Document):
...
tags = ListField(StringField())
...
Ideally what I'd like to do is to have users type in a series of tags and get an rss feed for a list of recent documents with that tag. Ex. .../subscribe/One/Two
would pull up a feed with tags of "One" and "Two".
I've mapped my urls.py file to match this:
url(r'^subscribe/(?P<pattern>.+)', KeywordsFeed(), name='subscribe')
But I keep getting an error saying that
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
Since I'm using mongoengine, my settings file looks like this:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.dummy',
}
}
MONGODB_NAME = 'mydb'
mongoengine.connect(MONGODB_NAME)
Here is feeds.py:
class KeywordsFeed(Feed):
title = "Data Request Repository"
link = "/"
description = "Description"
def get_object(self, request, pattern):
patternlist = string.split(pattern, r'/')
pdb.set_trace()
resultList = Request.objects(tags__in=patternlist)
if len(resultList<1):
raise ObjectDoesNotExist
return
def title(self, obj):
return obj.title
def description(self,obj):
return obj.description
def items(self, obj):
return obj
My thinking is that the syndication framework is doing some backend validation before serving the feed. I could also be understanding this framework wrong. Any advice would be much appreciated. Thanks!