分页: 1 / 1

Django 升级到4.0注意事项

帖子发表于 :周四 1月 20, 2022 4:12 pm
adm1n
in django 4.0 we dont have force_text

https://docs.djangoproject.com/en/4.0/r ... s.encoding

instead change force_text to force_str

linux:

YOUR_VENV/lib/PYTHON_VERSION/site-packages/graphene_django/utils/utils.py

windows:

YOUR_VENV/lib/site-packages/graphene_django/utils/utils.py

from django.utils.encoding import force_text
to

from django.utils.encoding import force_str
and
代码: 全选def _camelize_django_str(s): if isinstance(s, Promise): s = force_text(s) return to_camel_case(s) if isinstance(s, six.string_types) else s
to
代码: 全选def _camelize_django_str(s): if isinstance(s, Promise): s = force_str(s) return to_camel_case(s) if isinstance(s, six.string_types) else s