• 查看主题

  • 查看主题说明文字
日常笔记
#217 adm1n
周四 1月 20, 2022 4:12 pm
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