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

15
iamkonstantin_web/api.py Normal file
View file

@ -0,0 +1,15 @@
from wagtail.api.v2.views import PagesAPIViewSet
from wagtail.api.v2.router import WagtailAPIRouter
from wagtail.images.api.v2.views import ImagesAPIViewSet
from wagtail.documents.api.v2.views import DocumentsAPIViewSet
# Create the router. "wagtailapi" is the URL namespace
api_router = WagtailAPIRouter('wagtailapi')
# Add the three endpoints using the "register_endpoint" method.
# The first parameter is the name of the endpoint (such as pages, images). This
# is used in the URL of the endpoint
# The second parameter is the endpoint class that handles the requests
api_router.register_endpoint('pages', PagesAPIViewSet)
api_router.register_endpoint('images', ImagesAPIViewSet)
api_router.register_endpoint('documents', DocumentsAPIViewSet)