-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Hello, I had an ImportError when extracting the messages of my Django app. The message error was the following one:
from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
ImportError: cannot import name 'TOKEN_TEXT' from 'django.template.base' (c:\users\artac\appdata\local\programs\python\python37-32\lib\site-packages\django\template\base.py)
I managed to solve it by making some changes in the django_babel/extract.py file. Those changes where:
- Changing the line 2 imports to this:
from django.template.base import Lexer, TokenType - Changing the
extract_django(fileobj, keywords, comment_tags, options)method, replacing everyTOKEN_BLOCKtoTokenType.BLOCK,TOKEN_TEXTtoTokenType.TEXTandTOKEN_VARtoTokenType.VAR.
My package versions are:
- Django==2.1.7
- django-babel==0.6.2
- Babel==2.6.0
nikitagrygoriev
Metadata
Metadata
Assignees
Labels
No labels