blubber / django_injector

Dependency injection in Django.
BSD 2-Clause "Simplified" License
49 stars 7 forks source link

Issue with graphene-django csrf_exempt #19

Closed whysage closed 2 years ago

whysage commented 2 years ago

Hi!

May be this info will save some time to users.

Issue description:

  1. Add graphene-django to django project
  2. Use csrf_exempt for graphql/ urlpatterns = [ ... path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql'), ... ]
  3. csrf_exempt will not work :-(

The reason (as I understant, it's may be wrong) is than django_injector adds wrapper to view GraphQLView and removes .csrf_exempt = True from view

Just for now I removed django_injector from project, because for me just injector works good with graphene-django But may be it will be good to solve this issue.

whysage commented 2 years ago

@blubber pls check pr with solution https://github.com/blubber/django_injector/pull/20