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//", CategoryArticlesFeed(), name="rss_feed_by_category"), path("feed/tag//", 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)