graphene-django icon indicating copy to clipboard operation
graphene-django copied to clipboard

Django v4.0 support

Open MisterGlass opened this issue 3 years ago • 6 comments

Hello!

Django 4.0 is due out next week and I was attempting to test the release candidate with my project. Have there been any efforts to check/fix compatibility with the new version?

MisterGlass avatar Nov 30 '21 23:11 MisterGlass

Hi! I have error django-4 with graphene-2.15: ImportError: cannot import name 'force_text' from 'django.utils.encoding'

geniuz avatar Dec 10 '21 16:12 geniuz

Hi - Any update/ETA on this ?

Anmol-Porwal18 avatar Dec 21 '21 05:12 Anmol-Porwal18

I'll try to complete reviews related to Python / Django versions before the week ends.

ulgens avatar Dec 21 '21 08:12 ulgens

Quick workaround is to just change it to force_str in your library code until patch. I haven't seen any other immediate breakages

budleigh avatar Dec 25 '21 23:12 budleigh

After overcoming the force_str problem via monkeypatching, I have the problem of getting GraphiQL integrated.

With the previous code:

from graphene_django.views import GraphQLView

urlpatterns = [
    re_path(r'^api/graphql', csrf_exempt(GraphQLView.as_view(graphiql=True)), name='graphql'),
]

only this error message appears: ImportError: cannot import name 'get_default_backend' from 'graphql'

Does anyone have an idea how to get this fixed?

Edit: In the current beta version (v3.0.0b7) the problem is already fixed!

MaehMaeh avatar Jan 26 '22 20:01 MaehMaeh

Hi! I have error django-4 with graphene-2.15: ImportError: cannot import name 'force_text' from 'django.utils.encoding'

right, and you can shoud replace 'force_text' to 'force_str'

sanju-gif avatar Feb 04 '22 10:02 sanju-gif

@firaskafri Can you please give a reference / small explanation when closing issues, for the paper trail? Thank you.

ulgens avatar Sep 24 '22 15:09 ulgens

@firaskafri is it closed because graphene works with Django 4 now?

pors avatar Sep 24 '22 16:09 pors

Sorry guys, yes v3 supports Django 4 now

firaskafri avatar Sep 24 '22 17:09 firaskafri