diff --git a/examples/cookbook/cookbook/settings.py b/examples/cookbook/cookbook/settings.py index 1916201..801bf0f 100644 --- a/examples/cookbook/cookbook/settings.py +++ b/examples/cookbook/cookbook/settings.py @@ -38,6 +38,9 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'graphene_django', + + # a GUI for graphQL + 'django_graphiql', 'cookbook.ingredients.apps.IngredientsConfig', 'cookbook.recipes.apps.RecipesConfig', @@ -56,6 +59,7 @@ MIDDLEWARE_CLASSES = [ GRAPHENE = { 'SCHEMA': 'cookbook.schema.schema', + 'SCHEMA_INDENT': 2, 'MIDDLEWARE': ( 'graphene_django.debug.DjangoDebugMiddleware', ) @@ -130,8 +134,3 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' - -GRAPHENE = { - 'SCHEMA': 'cookbook.schema.schema', - 'SCHEMA_INDENT': 2, -} diff --git a/examples/cookbook/cookbook/urls.py b/examples/cookbook/cookbook/urls.py index 9410ca5..ee09d7f 100644 --- a/examples/cookbook/cookbook/urls.py +++ b/examples/cookbook/cookbook/urls.py @@ -1,9 +1,12 @@ from django.conf.urls import url +from django.conf.urls import include +from django.views.decorators.csrf import csrf_exempt from django.contrib import admin from graphene_django.views import GraphQLView urlpatterns = [ url(r'^admin/', admin.site.urls), - url(r'^graphql', GraphQLView.as_view(graphiql=True)), + url(r'^graphql', csrf_exempt(GraphQLView.as_view(graphiql=True))), + url(r'^graphiql', include('django_graphiql.urls')), ]