[1.5.x] Fixed #19076 -- Added content_type attribute to TemplateView.

Thanks Gavin Wahl.

Backport of 23e319d.