Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# auth.settings.py
INSTALLED_APPS = [
# ...
'django.contrib.staticfiles', # Required for GraphiQL
'graphene_django',
# refresh tokens are optional
'graphql_jwt.refresh_token.apps.RefreshTokenConfig',
]
MIDDLEWARE = [
# ...
'django.contrib.auth.middleware.AuthenticationMiddleware',
# ...
]
GRAPHENE = {
'SCHEMA': 'quickstart.schema.schema', # this file doesn't exist yet
'MIDDLEWARE': [
'graphql_jwt.middleware.JSONWebTokenMiddleware',
],
}
AUTHENTICATION_BACKENDS = [
'graphql_jwt.backends.JSONWebTokenBackend',
'django.contrib.auth.backends.ModelBackend',
]
GRAPHQL_JWT = {
"JWT_VERIFY_EXPIRATION": True,
# optional
"JWT_LONG_RUNNING_REFRESH_TOKEN": True,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.