Once application is installed to Django >4.0 project, or project Django is upgraded application throws an exception.
File "/home/.../.../.../envs3/lib64/python3.9/site-packages/user_sessions/models.py", line 3, in <module>
from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/home/rvk/Projects/kurzy-website/envs3/lib64/python3.9/site-packages/django/utils/translation/__init__.py)
Expected Behavior
Application should run the same as it would with older Django 3.*
Current Behavior
Applicaiotn with Django 4.* throws an exception.
Possible Solution
It seems to be an easy fix. Just replace:
from django.utils.translation import ugettext_lazy as _ with from django.utils.translation import gettext_lazy as _
Once application is installed to Django >4.0 project, or project Django is upgraded application throws an exception.
Expected Behavior
Application should run the same as it would with older Django 3.*
Current Behavior
Applicaiotn with Django 4.* throws an exception.
Possible Solution
It seems to be an easy fix. Just replace:
from django.utils.translation import ugettext_lazy as _
withfrom django.utils.translation import gettext_lazy as _
More at: https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation-removed-in-4-0
Steps to Reproduce (for bugs)
Context
I am trying to upgrade Django, but the app no longer works, and either I am not able to upgrade, or I have to disable django-user-sessions.