'ImportError: cannot import name 'force_str' from partially initialized module 'django.utils.encoding' (most likely due to a circular import)

I went to my utils.py and added and replaced their corresponding fields this:

from django.utils.encoding import force_str

plus this

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

But I still get the same error, what can I do?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source