django-two-factor-auth icon indicating copy to clipboard operation
django-two-factor-auth copied to clipboard

cannot import name 'ugettext_lazy' from 'django.utils.translation'

Open dopry opened this issue 3 years ago • 0 comments

When attempting to start the example with python manage.py runserver I get the error

from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'

Expected Behavior

Running the example should work.

Current Behavior

There is an error

Possible Solution

The requirement versions were unblock and pip is installing django 4, and django-user-session doesn't seems to be compatible with Django 4.0. ugettext_lazy has been removed.

  1. Update django-user-session to support django 4.0, see: https://github.com/jazzband/django-user-sessions/pull/142
  2. Fix the version of django to 3.2 until 4.0 is properly supported.
  3. pip install django==3.2 is a temporary workaround for the issue.

Steps to Reproduce (for bugs)

  1. pip install -r requirements_dev.txt
  2. cd example
  3. python manage.py runserver

Your Environment

  • Browser and version: N/A
  • Python version: 3.10
  • Django version: 4.0
  • django-otp version: N/A
  • django-two-factor-auth version: N/A
  • Link to your project: N/A

dopry avatar May 05 '22 18:05 dopry