Closed iceripple closed 11 years ago
Hi, try to write
import pyjade.ext.django
On the __init__.py
file of your project ;)
Or maybe just adding 'pyjade.ext.django'
into INSTALLED_APSS
Curiously, in Django 1.5, adding 'pyjade.ext.django'
in INSTALLED_APPS only will work if you use the command makemessages
with the --verbosity
parameter greather than one (-v 2
or -v 3
).
It happens because when is used --verbosity
greather than one, is displayed the message examining files with the extensions: ext1, ext2 and ext3
. This message uses the django.utils.translation import trans_real.ugettext
to translate the comma (', '
part) and so initialize the translation framework, including the load of the INSTALLED_APPS
, to load the locale
directory of them, and so, the templatize
pyjade decorator is installed.
It not happens when the parameter --verbosity
is not used or is used as one, because that way no message is displayed, and so the translations framework is not loaded and no installed app is loaded either.
I suggest add import pyjade.ext.django
at the top of the settings file, there it always will be read when the command is run.
Hi, any suggestions how we can use django templates and jade templates? If running makemessages with pyjade.ext.django, django templates prints following error: Exception: unexpected token "indent" in file None on line 10 , file is .html file and line 10 is just empty line.
I will check it later.
Seems that pyjade is processing not only .jade
files, but also .html
ones.
I have the same issue but using django 1.7.4 I tried adding import pyjade.ext.django
to __init__.py
and adding 'pyjade.ext.django' to INSTALLED_APPS. Any idea ?
I met the same problem. Deeply custom tags are huge hazards in a black box working with various Django backend. A less intrusive method is more appealing, say pre-processing the custom tags.
Django's makemessages management command does not collect strings for translation under -trans or -blocktrans
No idea if that is even possible.
workaround is to use original django style tags {% trans %} and {%blocktrans%}