Skip to content

Commit

Permalink
fixup! Add script to create RSS and Atom feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
knatten committed Feb 21, 2025
1 parent 8b8a48e commit 4623053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quiz/management/commands/generate_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def handle(self, *args, **options):
question = atom_question if feed_format == "atom" else rss_question
footer = atom_footer if feed_format == "atom" else rss_footer

last_build_date = datetime.datetime.now().strftime("%a, %d %b %Y %H:%M:%S %z")
last_build_date = datetime.datetime.now().strftime("%a, %d %b %Y %H:%M:%S GMT")
print(header.replace("{{last_build_date}}", last_build_date))

for q in get_published_questions().order_by('-publish_time')[:self.post_count]:
url = settings.SITE_URL + reverse('quiz:question', args=[q.pk])
print(question.replace("{{id}}", str(q.id)).replace("{{url}}", url).replace(
"{{pubdate}}", q.publish_time.strftime("%a, %d %b %Y %H:%M:%S %z")))
"{{pubdate}}", q.publish_time.strftime("%a, %d %b %Y %H:%M:%S GMT")))

print(footer)

0 comments on commit 4623053

Please sign in to comment.