Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27336 closed Cleanup/optimization (wontfix)

Whitespace control django configuration template

Reported by: Ramin Farajpour Cami Owned by: nobody
Component: Template system Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ramin Farajpour Cami)

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

Attachments (1)

123213.PNG (80.5 KB ) - added by Ramin Farajpour Cami 8 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by Ramin Farajpour Cami, 8 years ago

Description: modified (diff)

comment:2 by Tim Graham, 8 years ago

Could you give more details about the problem, including steps to reproduce?

comment:3 by Aymeric Augustin, 8 years ago

Resolution: worksforme
Status: newclosed

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

by Ramin Farajpour Cami, 8 years ago

Attachment: 123213.PNG added

comment:4 by Ramin Farajpour Cami, 8 years ago

Resolution: worksforme
Status: closednew

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) ,

comment:5 by Tim Graham, 8 years ago

Resolution: invalid
Status: newclosed

The Django admin uses the Django template language (and its behavior won't be changed as #2594 says), not Jinja2.

comment:6 by Ramin Farajpour Cami, 8 years ago

Resolution: invalidwontfix

comment:7 by Aymeric Augustin, 8 years ago

It's amazing that the admin renders at all with Jinja2.

in reply to:  7 comment:8 by Ramin Farajpour Cami, 8 years ago

Replying to Aymeric Augustin:

It's amazing that the admin renders at all with Jinja2.

can you explain why use django template language?

comment:9 by Ramin Farajpour Cami, 8 years ago

Summary: Whitespace control django configuration Jinja2Whitespace control django configuration template

comment:10 by Aymeric Augustin, 8 years ago

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.

Note: See TracTickets for help on using tickets.
Back to Top