This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
79 lines (68 loc) · 3.17 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.contrib.sitemaps.views import sitemap
from django.contrib.staticfiles.views import serve
from django.views.decorators.csrf import csrf_exempt
from django.views.i18n import JavaScriptCatalog, set_language
from saleor.account.urls import urlpatterns as account_urls
from saleor.checkout.urls import checkout_urlpatterns as checkout_urls
from saleor.core.sitemaps import sitemaps
from saleor.core.urls import urlpatterns as core_urls
from saleor.dashboard.urls import urlpatterns as dashboard_urls
from saleor.data_feeds.urls import urlpatterns as feed_urls
from saleor.graphql.api import schema
from saleor.graphql.views import GraphQLView
from saleor.order.urls import urlpatterns as order_urls
from saleor.page.urls import urlpatterns as page_urls
from saleor.product.urls import urlpatterns as product_urls
from saleor.search.urls import urlpatterns as search_urls
handler404 = "saleor.core.views.handle_404"
non_translatable_urlpatterns = [
url(r"^dashboard/", include((dashboard_urls, "dashboard"), namespace="dashboard")),
url(r"^graphql/", csrf_exempt(GraphQLView.as_view(schema=schema)), name="api"),
url(
r"^sitemap\.xml$",
sitemap,
{"sitemaps": sitemaps},
name="django.contrib.sitemaps.views.sitemap",
),
url(r"^i18n/$", set_language, name="set_language"),
url("", include("social_django.urls", namespace="social")),
]
translatable_urlpatterns = [
url(r"^", include(core_urls)),
url(r"^checkout/", include((checkout_urls, "checkout"), namespace="checkout")),
url(r"^jsi18n/$", JavaScriptCatalog.as_view(), name="javascript-catalog"),
url(r"^order/", include((order_urls, "order"), namespace="order")),
url(r"^page/", include((page_urls, "page"), namespace="page")),
url(r"^products/", include((product_urls, "product"), namespace="product")),
url(r"^account/", include((account_urls, "account"), namespace="account")),
url(r"^feeds/", include((feed_urls, "data_feeds"), namespace="data_feeds")),
url(r"^search/", include((search_urls, "search"), namespace="search")),
]
urlpatterns = non_translatable_urlpatterns + i18n_patterns(*translatable_urlpatterns)
if settings.DEBUG:
try:
import debug_toolbar
except ImportError:
"""The debug toolbar was not installed. Ignore the error.
settings.py should already have warned the user about it."""
else:
urlpatterns += [url(r"^__debug__/", include(debug_toolbar.urls))]
urlpatterns += [
# static files (images, css, javascript, etc.)
url(r"^static/(?P<path>.*)$", serve)
] + static("/media/", document_root=settings.MEDIA_ROOT)
if settings.ENABLE_SILK:
urlpatterns += [url(r"^silk/", include("silk.urls", namespace="silk"))]
# Divio Cloud specific
from aldryn_django.utils import i18n_patterns
import aldryn_addons.urls
urlpatterns = urlpatterns + [
# add your own patterns here
] + aldryn_addons.urls.patterns() + i18n_patterns(
# add your own i18n patterns here
*aldryn_addons.urls.i18n_patterns() # MUST be the last entry!
)