17π
β
Ok, I just found it.
GRAPHENE = {
'SCHEMA': 'hackernews.schema.schema',
'MIDDLEWARES': ['graphql_jwt.middleware.JSONWebTokenMiddleware'],
}
Notice the S
. It needs to be 'MIDDLEWARES'
, not 'MIDDLEWARE'
.
Found the solution on this GitHub issue
Also, according to this comment on the same issue, you should add 'graphql_jwt.middleware.JSONWebTokenMiddleware'
to the MIDDLEWARE
list (the one with all the Django middleware).
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'graphql_jwt.middleware.JSONWebTokenMiddleware', ### <---Add this line
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
π€tbrlpld
- South with django 1.7
- Table 'MyDjango.django_admin_log' doesn't exist
- Language Localization of Khan Academy
- Django 'model' object is not iterable
0π
Faced this issue when we moved from Django 2.2 to Django 4.0.5 version.
Updated the DRF version from 3.12.0 to 3.14.0 to fix this issue.
pip install djangorestframework==3.14.0
- Django run tasks (possibly) in the far future
- (Re)Checking Dependencies with PIP
- Django REST Framework: Per-user throttles
- Django View Causes Psycopg2 Cursor Does/Does Not Exist Error
Source:stackexchange.com