Example #1
0
def _handler500(request):
    return Handler50xView.as_view()(request)
Example #2
0
    re_path(r'^users/', include(('api.users.urls', 'users'),
                                namespace='users')),
    re_path(r'^oauth/', include(('api.oauth.urls', 'oauth'),
                                namespace='oauth')),
    re_path(r'^_admin/logout/$', LogoutView.as_view(), name='logout'),
    re_path(r'^_admin/login/$',
            RedirectView.as_view(url=conf.get(LOGIN_URL),
                                 permanent=True,
                                 query_string=True),
            name='login'),
    re_path(r'^_health/?$', HealthView.as_view(), name='health_check'),
    re_path(r'^_status/?$', StatusView.as_view(), name='status_check'),
    re_path(r'^{}/'.format(API_V1),
            include((api_patterns, 'v1'), namespace='v1')),
    re_path(r'^$', IndexView.as_view(), name='index'),
    re_path(r'^50x.html$', Handler50xView.as_view(), name='50x'),
    re_path(r'^app.*/?',
            login_required(ensure_csrf_cookie(ReactIndexView.as_view())),
            name='react-index'),
]


def _handler500(request):
    return Handler50xView.as_view()(request)


handler404 = Handler404View.as_view()
handler403 = Handler403View.as_view()
handler500 = _handler500

if conf.get(ADMIN_VIEW_ENABLED):