Hi!
My site have started to behave a little weird.
Lately, I get two or three errors per day, saying:
Traceback (most recent call last):
File "/home/mistalaba/.virtualenvs/production/lib/python2.5/site-
packages/django/core/handlers/base.py", line 95, in get_response
response = middleware_method(request, callback, callback_args,
callback_kwargs)
File "/home/mistalaba/.virtualenvs/production/lib/python2.5/site-
packages/django/middleware/doc.py", line 18, in process_view
response['X-View'] = "%s.%s" % (view_func.__module__,
view_func.__name__)
AttributeError: 'LatestStripsByStripConfig' object has no attribute
'__name__'
I don't know why this is appearing all of a sudden, I haven't changed
the code, but I don't know where to start debugging this.
Here is my feeds.py, rather straightforward:
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from strip.models import StripConfig, Strip
class LatestStripsByStripConfig(Feed):
#__name__ = 'LatestStripsByStripConfig'
description_template = 'feeds/latest_description.html'
def get_object(self, request, stripconfig):
return get_object_or_404(StripConfig, slug=stripconfig)
def title(self, obj):
return "Scandinavian Comics RSS feed for %s" % obj.strip_name
def link(self, obj):
return "%s?utm_source=feed&utm_medium=%s" %
(obj.get_absolute_url(), obj.strip_name)
def description(self, obj):
return "The latest %s comic strips. See more at
http://www.scandinavian-comics.com/strips/" % obj.strip_name
def items(self, obj):
return
Strip.objects.filter(strip_config__slug=obj.slug).order_by('-date')[:
10]
def item_link(self, item):
return "%s?utm_source=feed&utm_medium=%s&utm_campaign=%s" %
(item.get_absolute_url(), item.strip_config, item)
Does anyone have some wise suggestions? I would really appreciate it!
Thank you!