Skip to main content

JSON Web Token for Django GraphQL

Project description

Pypi Build Status Codecov Codeclimate

JSON Web Token authentication for Django GraphQL


Install last stable version from Pypi:

pip install django-graphql-jwt

Add AuthenticationMiddleware middleware to your MIDDLEWARE settings:


Add JSONWebTokenMiddleware middleware to your GRAPHENE settings:

    'SCHEMA': 'mysite.myschema.schema',

Add JSONWebTokenBackend backend to your AUTHENTICATION_BACKENDS:



Add django-graphql-jwt mutations to the root schema:

import graphene
import graphql_jwt

class Mutation(graphene.ObjectType):
    token_auth = graphql_jwt.ObtainJSONWebToken.Field()
    verify_token = graphql_jwt.Verify.Field()
    refresh_token = graphql_jwt.Refresh.Field()

schema = graphene.Schema(mutation=Mutation)


Fantastic documentation is available at

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-graphql-jwt, version 0.2.1
Filename, size & hash File type Python version Upload date
django-graphql-jwt-0.2.1.tar.gz (14.7 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page