Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Authorization with django-graphene
- # using django-jwt-auth==0.0.2
- from django.conf.urls import url
- from django.views.decorators.csrf import csrf_exempt
- from graphene_django.views import GraphQLView
- from jwt_auth.mixins import JSONWebTokenAuthMixin
- class AuthGraphQLView(JSONWebTokenAuthMixin, GraphQLView):
- """Graphene view with JWT authentication."""
- pass
- urlpatterns = [
- url(
- regex=r'^$',
- view=csrf_exempt(AuthGraphQLView.as_view(graphiql=True)),
- name='graphql'
- ),
- ]
Add Comment
Please, Sign In to add comment