#554 closed defect (fixed)
RSS feeds are not valid due to missing timezone in pubdates
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.syndication | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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 (1)
Change History (3)
by , 19 years ago
Attachment: | feedgenerator_patch.txt added |
---|
comment:1 by , 19 years ago
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']), {})
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(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
path file