You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 every TOKEN_BLOCK to TokenType.BLOCK, TOKEN_TEXT to TokenType.TEXT and TOKEN_VAR to TokenType.VAR.
My package versions are:
Django==2.1.7
django-babel==0.6.2
Babel==2.6.0
The text was updated successfully, but these errors were encountered:
Hello, I had an ImportError when extracting the messages of my Django app. The message error was the following one:
I managed to solve it by making some changes in the django_babel/extract.py file. Those changes where:
from django.template.base import Lexer, TokenType
extract_django(fileobj, keywords, comment_tags, options)
method, replacing everyTOKEN_BLOCK
toTokenType.BLOCK
,TOKEN_TEXT
toTokenType.TEXT
andTOKEN_VAR
toTokenType.VAR
.My package versions are:
The text was updated successfully, but these errors were encountered: