TemplateView does not support setting mime type, like views.generic.simple.direct_to_template did
|Reported by:||Owned by:||nobody|
|Cc:||bmispelon@…, mail@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
direct_to_template to serve my robots.txt, like this:
urlpatterns = patterns('', url('^robots.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')), ...
In Django 1.5 this is no longer possible, because the function-based generic views are removed, and TemplateView does not have a mime/content type argument.
I think that a
content_type argument should be added to TemplateView to add the same functionality that was in the function-based view. Patch to come.