from django.urls import include, re_path from .feeds import RssShowFeed, AtomShowFeed, AtomRedirectView, RssRedirectView from .models import MIME_CHOICES MIMES = "|".join([enclosure[0] for enclosure in MIME_CHOICES]) urlpatterns = [ # Episode list feed by podcast (RSS 2.0 and iTunes) re_path(r"^(?P[-\w]+)/(?P{mimes})/rss/$".format(mimes=MIMES), RssShowFeed(), name="podcasts_show_feed_rss"), # Episode list feed by show (Atom) re_path(r"^(?P[-\w]+)/(?P{mimes})/atom/$".format(mimes=MIMES), AtomShowFeed(), name="podcasts_show_feed_atom"), ]