Django

Code

Ticket #554 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

RSS feeds are not valid due to missing timezone in pubdates

Reported by: hugo <gb@bofh.ms> Assigned to: adrian
Milestone: Component: RSS framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When the RSS feed includes the pubDate tag and that is taken from a datetime field of a model, the strftime(...) stuff creates a date without timezone - that's because %Z doesn't seem to be implemented with datetime.strftime. Instead of the timezone an emtpy string is returned and so the feed validator doesn't see this feed as valid.

Attachments

feedgenerator_patch.txt (1.5 kB) - added by ismael@ati.es on 10/07/05 10:38:49.
path file

Change History

10/07/05 10:38:49 changed by ismael@ati.es

  • attachment feedgenerator_patch.txt added.

path file

10/07/05 10:45:30 changed by ismael@ati.es

To make the date RSS-valid is posible to use module email email.Utils.formatdate

+    def rfc2822Date( self, date ):        
+        return email.Utils.formatdate( time.mktime( date.timetuple() ) )

         if item['pubdate'] is not None:
+            handler.addQuickElement(u"pubDate", self.rfc2822Date(item['pubdate']), {})

11/11/05 21:44:55 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [1194]) Completely refactored legacy RSS framework to the new django.contrib.syndication package. Also added Atom support, changed the way feeds are registered and added documentation for the whole lot. This is backwards-incompatible, but the RSS framework had not yet been documented, so this should only affect tinkerers and WorldOnline. Fixes #329, #498, #502 and #554. Thanks for various patches/ideas to alastair, ismael, hugo, eric moritz and garthk


Add/Change #554 (RSS feeds are not valid due to missing timezone in pubdates)




Change Properties
Action