Ticket #6039: atom-feed.diff
File atom-feed.diff, 1.2 KB (added by , 16 years ago) |
---|
-
docs/ref/contrib/syndication.txt
912 912 913 913 For example, to create an Atom 1.0 feed and print it to standard output:: 914 914 915 >>> from datetime import datetime 915 916 >>> from django.utils import feedgenerator 917 >>> 916 918 >>> f = feedgenerator.Atom1Feed( 917 919 ... title=u"My Weblog", 918 920 ... link=u"http://www.example.com/", 919 921 ... description=u"In which I write about what I ate today.", 920 ... language=u"en") 922 ... language=u"en", 923 ... author_name=u"Myself", 924 ... feed_url=u"http://www.example.com/atom.xml") 921 925 >>> f.add_item(title=u"Hot dog today", 922 926 ... link=u"http://www.example.com/entries/1/", 927 ... pubdate=datetime.now(), 923 928 ... description=u"<p>Today I had a Vienna Beef hot dog. It was pink, plump and perfect.</p>") 924 >>> print f.writeString('utf 8')925 <?xml version="1.0" encoding="utf 8"?>929 >>> print f.writeString('utf-8') 930 <?xml version="1.0" encoding="utf-8"?> 926 931 <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"> 927 932 ... 928 933 </feed>