Ticket #7936: syndication-lastmodified.diff
File syndication-lastmodified.diff, 813 bytes (added by , 16 years ago) |
---|
-
django/contrib/syndication/views.py
1 1 from django.contrib.syndication import feeds 2 2 from django.http import HttpResponse, Http404 3 from django.utils.http import http_date 4 import time 3 5 4 6 def feed(request, url, feed_dict=None): 5 7 if not feed_dict: … … 21 23 raise Http404, "Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not." % slug 22 24 23 25 response = HttpResponse(mimetype=feedgen.mime_type) 26 response['Last-Modified'] = http_date(time.mktime(feedgen.latest_post_date().timetuple())) 24 27 feedgen.write(response, 'utf-8') 25 28 return response