martinrusev / django-redis-sessions

Session backend for Django that stores sessions in a Redis database
BSD 3-Clause "New" or "Revised" License
495 stars 106 forks source link

Fix "RemovedInDjango40Warning: force_text()..." warning #64

Closed eblume closed 4 years ago

eblume commented 4 years ago

Currently, as of Django 3.0 (https://docs.djangoproject.com/en/3.0/releases/3.0/#features-deprecated-in-3-0), importing force_text causes a warning notice. This can clutter up test runs as warnings are surfaced by pytest, and other tools may have this issue as well.

The method has been renamed to force_str. However, note that force_str is not to be used with python 2.7, where you should instead continue to use force_unicode.

This PR fixes this issue while supporting all known configurations of python and django versions.

Please verify this fix, as I am not set up properly with your testing environment.

merwok commented 3 years ago

Thanks for fixing this! @martinrusev could you tell us when this will be released?

martinrusev commented 3 years ago

@merwok Just released it on pypi