Django 1.8 has an undocumented change regarding template comments

78 views
Skip to first unread message

Robert Rollins

unread,
Jul 30, 2015, 9:48:16 PM7/30/15
to Django developers (Contributions to Django itself)
I can't tell which exact release introduced this, since I went directly from 1.7.9 to 1.8.3, but one of my templates suddenly started rendering differently when I did.

The template had a typo with one of its {# #}-style template comments; it was accidentally written as: {# comment here %}.

This wasn't noticeable in Django 1.7.9, though, because it would still treat that whole line like a comment, and "comment here" would not appear in the rendered output. But as soon as I installed Django 1.8.3, I started seeing the entire "{# comment here %}" text in the rendered output.

Anyone know what code change triggered this altered rendering behavior? There's no mention of changes to template comments in any of the release notes for Django 1.8.x.

charettes

unread,
Jul 30, 2015, 11:11:16 PM7/30/15
to Django developers (Contributions to Django itself), coredu...@gmail.com
Hi Robert,

I don't exactly know which release introduced this change but I'd bet on 1.8.0 since a lot template related logic was refactored during its development.

If you want to isolate the exact commit I'd suggest you try bisecting [1] Django's source.

I think the change was unintentional but the fact that "{# foo %}" wasn't displayed in 1.7.9 looks like a bug to me.

Simon

[1] https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression
Reply all
Reply to author
Forward
0 new messages