Implements Issue #35 with category snippets, article category routing, category-aware templates, and category RSS feeds with tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
30 lines
1.3 KiB
Python
30 lines
1.3 KiB
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
from django.views.generic import RedirectView
|
|
from wagtail import urls as wagtail_urls
|
|
from wagtail.contrib.sitemaps.views import sitemap
|
|
|
|
from apps.blog.feeds import AllArticlesFeed, CategoryArticlesFeed, TagArticlesFeed
|
|
from apps.core.views import consent_view, robots_txt
|
|
|
|
urlpatterns = [
|
|
path("django-admin/", admin.site.urls),
|
|
path("cms/", include("wagtail.admin.urls")),
|
|
path("documents/", include("wagtail.documents.urls")),
|
|
path("comments/", include("apps.comments.urls")),
|
|
path("newsletter/", include("apps.newsletter.urls")),
|
|
path("consent/", consent_view, name="consent"),
|
|
path("robots.txt", robots_txt, name="robots_txt"),
|
|
path("feed/", AllArticlesFeed(), name="rss_feed"),
|
|
path("feed/category/<slug:category_slug>/", CategoryArticlesFeed(), name="rss_feed_by_category"),
|
|
path("feed/tag/<slug:tag_slug>/", TagArticlesFeed(), name="rss_feed_by_tag"),
|
|
path("sitemap.xml", sitemap),
|
|
path("admin/", RedirectView.as_view(url="/cms/", permanent=False)),
|
|
path("", include(wagtail_urls)),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|