-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathurls.py
51 lines (38 loc) · 1.47 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
Django URL dispatcher for the sitemap package.
It contains the following routes:
* ``/sitemap.xml`` is routed to :mod:`~integreat_cms.sitemap.views.SitemapIndexView`
* ``/<region_slug>/<language_slug>/sitemap.xml`` is routed to :mod:`~integreat_cms.sitemap.views.SitemapView`
See :mod:`~integreat_cms.core.urls` for the other namespaces of this application.
For more information on this file, see :doc:`django:topics/http/urls`.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from django.urls import include, path
from .views import SitemapIndexView, SitemapView
if TYPE_CHECKING:
from typing import Final
from django.urls.resolvers import URLPattern
#: The namespace for this URL config (see :attr:`django.urls.ResolverMatch.app_name`)
app_name: Final = "sitemap"
#: The url patterns of this module (see :doc:`django:topics/http/urls`)
urlpatterns: list[URLPattern] = [
path("sitemap.xml", SitemapIndexView.as_view(), name="index"),
path("wp-json/ig-sitemap/v1/sitemap-index.xml", SitemapIndexView.as_view()),
path(
"<slug:region_slug>/<slug:language_slug>/",
include(
[
path(
"sitemap.xml",
SitemapView.as_view(),
name="region_language",
),
path(
"wp-json/ig-sitemap/v1/sitemap.xml",
SitemapView.as_view(),
),
],
),
),
]