Make the graphql endpoint CSRF exempt
This commit is contained in:
1 parent
dd6a559ac6
commit
f1ea46188f
1 file changed
+2
-1
+2
-1
@@ -2,6 +2,7 @@ from django.conf import settings
|
|||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.auth.views import LoginView, LogoutView
|
from django.contrib.auth.views import LoginView, LogoutView
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from strawberry.django.views import GraphQLView
|
from strawberry.django.views import GraphQLView
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ urlpatterns = [
|
|||||||
name="django.contrib.auth.views.logout",
|
name="django.contrib.auth.views.logout",
|
||||||
),
|
),
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
path("graphql/", GraphQLView.as_view(schema=schema), name="graphql"),
|
path("graphql/", csrf_exempt(GraphQLView.as_view(schema=schema)), name="graphql"),
|
||||||
]
|
]
|
||||||
|
|
||||||
urlpatterns += static("/media", document_root=settings.MEDIA_ROOT)
|
urlpatterns += static("/media", document_root=settings.MEDIA_ROOT)
|
||||||
|
|||||||
Reference in new issue
Block a user