coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
913 stars 377 forks source link

ImportError: cannot import name 'force_text' from 'django.utils.encoding' #228

Open Qbes179s opened 2 years ago

Qbes179s commented 2 years ago

Checklist

Steps to reproduce

Expected behavior

Actual behavior

franhace commented 1 year ago

Hey @Qbes179s which django version are you using? The pypi version of this package is not updated, hence doesn't support django versions >= 4, where force_text was removed. In that case you should pip clone the package.

ddahan commented 1 year ago

Thanks this helped me. The documentation is a little misleading, because the remote package name is the same than the extracted folder. So it's easy to pip install the remote package instead of the extracted one ^^

However, may I ask why the package is not updated? It seems the project is not maintained by the initial author. However, as the Github repo seems to be up to date, why not the pypi package?

arthanson commented 1 year ago

Just a matter of time, will try to look into getting one released soon, but there is some tooling stuff I have to check on.

ddahan commented 1 year ago

@arthanson Thanks for the answer.

My bad, I was struggling with the installation doc, until I realised these are not 3 steps to follow, but 3 different ways to install django-cities.

I feel a little dumb, but I suggest clarifying this step anyway, with:

  1. Adding a There are 3 different ways to install the project: paragraph
  2. Dissuading people to use the pip install solution as it's currently not maintained.

Maybe the best way to install the project at the time is to use pip (or another package manager like Poetry), but pointing to the git repository. Something like:

pip install git+https://github.com/coderholic/django-cities.git should work.

Doing this:

What do you think?