示例#1
0
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import RedirectView

import core.views
import export_readiness.views

api_router = WagtailAPIRouter('api')
api_router.register_endpoint('pages', core.views.PagesOptionalDraftAPIEndpoint)

api_urls = [
    url(r'^', api_router.urls),
    url(r'^pages/lookup-by-slug/(?P<slug>[\w-]+)/',
        api_router.wrap_view(
            core.views.PageLookupBySlugAPIEndpoint.as_view(
                {'get': 'detail_view'})),
        name='lookup-by-slug'),
    url(r'^pages/lookup-by-full-path/$',
        api_router.wrap_view(
            core.views.PageLookupByFullPathAPIEndpoint.as_view(
                {'get': 'detail_view'})),
        name='lookup-by-full-path'),
    url(r'^pages/lookup-by-tag/(?P<slug>[\w-]+)/$',
        api_router.wrap_view(
            export_readiness.views.PageLookupByTagListAPIEndpoint.as_view()),
        name='lookup-by-tag-list'),
    url(r'^pages/types/$',
        core.views.PageTypeView.as_view(),
        name='pages-types-list')
]
示例#2
0
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import RedirectView
from django.urls import path

import core.views
from groups.views import GroupInfoModalView

api_router = WagtailAPIRouter('api')
api_router.register_endpoint('pages', core.views.PagesOptionalDraftAPIEndpoint)

api_urls = [
    url(r'^', api_router.urls),
    url(r'^pages/lookup-by-slug/(?P<slug>[\w-]+)/',
        api_router.wrap_view(
            core.views.PageLookupBySlugAPIEndpoint.as_view(
                {'get': 'detail_view'})),
        name='lookup-by-slug'),
    url(r'^pages/lookup-by-path/(?P<site_id>[0-9]+)/(?P<path>[\w\-/]*)$',
        api_router.wrap_view(
            core.views.PageLookupByPathAPIEndpoint.as_view(
                {'get': 'detail_view'})),
        name='lookup-by-path'),
    url(r'^pages/types/$',
        core.views.PageTypeView.as_view(),
        name='pages-types-list'),
]

healthcheck_urls = [
    url(r'^$',
        directory_healthcheck.views.HealthcheckView.as_view(),