Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Error from the 17th line of views.py:
ImportError: cannot import name 'ugettext' from 'django.utils.translation'
The mentioned error appears when running python3.10 and Django4.0.
17th line of views.py:
from django.utils.translation import ugettext as _
As 'ugettext_lazy' has been deprecated for django 3+, it is possible to use 'gettext_lazy' instead without 'u'.
An 'if' was added to check the Django version and use the correct function preserving the compatibility for previous versions of django-docs.