If you see "cannot import name 'ugettext_lazy'" in Django, Django 4.0 might be installed
Django
2021-12-11 13:51 (4 years ago)

When you run manage.py hoge in Django
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3.8/site-packages/django/utils/translation/__init__.py)
If you encounter this error, it is possible that Django 4.0 is installed.
By the way, if you're installing dependencies with Pipenv in a Dockerfile, you can use the following commands:
COPY Pipfile /tmp/Pipfile
COPY Pipfile.lock /tmp/Pipfile.lock
...
RUN PIPENV_PIPFILE=/tmp/Pipfile pipenv install --system --ignore-pipfile --deploy
By adding the --ignore-pipfile option, the installation behavior will be similar to pipenv sync, which installs from the Pipfile.lock.
Please rate this article (No signup or login required)
Current rating: 2.5 (2)
Related posts
How to Fix Display Issues in Django Admin Inlines After Upgrading to 5.1
Return Login and Redirect Views by Hardcoding Social Account Provider in django-allauth (When Using AWS Cognito, etc.)
After Upgrading to Django 5 and Updating Dependencies, SSL: CERTIFICATE_VERIFY_FAILED Error Occurs When Sending Emails
The "first" and "second" Arguments of assertEqual in Django's Unit Tests are Actually "expected" and "actual"
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.