i see on django admin panle anything Whitespace control Jinja2 ,so i think
django can not support defulat whitespace control, this means
`trim_blocks` and `lstrip_blocks enabled` is disbale,
Jinja2 WhiteSpace Control is what you need :
http://jinja.pocoo.org/docs/templates/#whitespace-control
--
Ticket URL: <https://code.djangoproject.com/ticket/27336>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> Hi,
>
> i see on django admin panle anything Whitespace control Jinja2 ,so i
> think django can not support defulat whitespace control, this means
> `trim_blocks` and `lstrip_blocks enabled` is disbale,
>
> Jinja2 WhiteSpace Control is what you need :
> http://jinja.pocoo.org/docs/templates/#whitespace-control
New description:
Hi,
i see on django admin panle,there isn't Whitespace control on jinja2
template ,so i think django can not support defulat whitespace control,
this means `trim_blocks` and `lstrip_blocks enabled` is disbale,
Jinja2 WhiteSpace Control is what you need :
http://jinja.pocoo.org/docs/templates/#whitespace-control
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:1>
Comment (by Tim Graham):
Could you give more details about the problem, including steps to
reproduce?
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:2>
* status: new => closed
* resolution: => worksforme
Comment:
You can pass arbitrary options such as `trim_blocks` to
`jinja2.Environment` by putting them in `OPTIONS`:
https://docs.djangoproject.com/en/1.10/topics/templates/#django.template.backends.jinja2.Jinja2
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:3>
* Attachment "123213.PNG" added.
* status: closed => new
* resolution: worksforme =>
Comment:
Steps :
1- Go to http://127.0.0.1:8000/admin/auth/user/
2- right click browser inspect-element on header message `WELCOME, Test.
VIEW SITE / CHANGE PASSWORDUSER-TOOLSLOG OUT`
3- you see many space from render (Attach image) ,
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:4>
* status: new => closed
* resolution: => invalid
Comment:
The Django admin uses the Django template language (and its behavior won't
be changed as #2594 says), not Jinja2.
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:5>
* resolution: invalid => wontfix
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:6>
Comment (by Aymeric Augustin):
It's amazing that the admin renders at all with Jinja2.
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:7>
Comment (by Ramin Farajpour Cami):
Replying to [comment:7 Aymeric Augustin]:
> It's amazing that the admin renders at all with Jinja2.
can you explain why use django template language?
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:8>
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:9>
Comment (by Aymeric Augustin):
Well I'm not sure what needs to be explained... The Django admin uses the
Django template language, that's it...
It was implemented before Jinja2 existed and 10 years before Django added
first class support for Jinja2.
--
Ticket URL: <https://code.djangoproject.com/ticket/27336#comment:10>