23 lines
890 B
Python
23 lines
890 B
Python
from django.conf import settings
|
|
from django.conf.urls import url
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from graphene_django.views import GraphQLView
|
|
|
|
from api.schema_public import schema
|
|
|
|
from core.views import PrivateGraphQLView, ConfirmationKeyView
|
|
|
|
app_name = 'api'
|
|
urlpatterns = [
|
|
url(r'^graphql-public', csrf_exempt(GraphQLView.as_view(schema=schema))),
|
|
url(r'^graphql', csrf_exempt(PrivateGraphQLView.as_view())),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += [url(r'^graphiql-public', csrf_exempt(GraphQLView.as_view(schema=schema, graphiql=True,
|
|
pretty=True)))]
|
|
urlpatterns += [url(r'^graphiql', csrf_exempt(PrivateGraphQLView.as_view(graphiql=True, pretty=True)))]
|
|
urlpatterns += [url(r'^confirmation', ConfirmationKeyDisplayView.as_view(), name='confirmation_key_display')]
|
|
|
|
|