Guest User

Untitled

a guest
Feb 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # Authorization with django-graphene
  2. # using django-jwt-auth==0.0.2
  3. from django.conf.urls import url
  4. from django.views.decorators.csrf import csrf_exempt
  5.  
  6. from graphene_django.views import GraphQLView
  7. from jwt_auth.mixins import JSONWebTokenAuthMixin
  8.  
  9.  
  10. class AuthGraphQLView(JSONWebTokenAuthMixin, GraphQLView):
  11. """Graphene view with JWT authentication."""
  12. pass
  13.  
  14.  
  15. urlpatterns = [
  16. url(
  17. regex=r'^$',
  18. view=csrf_exempt(AuthGraphQLView.as_view(graphiql=True)),
  19. name='graphql'
  20. ),
  21. ]
Add Comment
Please, Sign In to add comment