feat: enable translations and rest api

This commit is contained in:
Konstantin 2024-11-23 14:59:51 +01:00
parent e98db55a16
commit 310fd5ed7a
Signed by: konstantin
GPG key ID: A128B78773E41ACE
4 changed files with 48 additions and 9 deletions

View file

@ -9,6 +9,7 @@ from wagtail import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from blog.feeds import RssBlogFeed
from iamkonstantin_web.api import api_router
from newsletter import views as newsletter_views
from search import views as search_views
from wagtail.contrib.sitemaps.views import sitemap
@ -26,6 +27,10 @@ urlpatterns = [
path('newsletter/thanks', newsletter_views.thanks, name='thanks')
]
urlpatterns += [
path('api/v2/', api_router.urls),
]
# Translatable URLs
# These will be available under a language code prefix. For example /en/search/
urlpatterns += i18n_patterns(
@ -42,12 +47,12 @@ if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += path("__reload__/", include("django_browser_reload.urls")),
urlpatterns = urlpatterns + [
# For anything not caught by a more specific rule above, hand over to
# Wagtail's page serving mechanism. This should be the last pattern in
# the list:
path("", include(wagtail_urls)),
# Alternatively, if you want Wagtail pages to be served from a subpath
# of your site, rather than the site root:
# path("pages/", include(wagtail_urls)),
]
# urlpatterns = urlpatterns + [
# # For anything not caught by a more specific rule above, hand over to
# # Wagtail's page serving mechanism. This should be the last pattern in
# # the list:
# path("", include(wagtail_urls)),
# # Alternatively, if you want Wagtail pages to be served from a subpath
# # of your site, rather than the site root:
# # path("pages/", include(wagtail_urls)),
# ]