#1504: Allow render_to_response() to take a content-type param -------------------------------------+------------------------------------- Reporter: django@… | Owner: nobody Type: enhancement | Status: closed Component: Template system | Version: master Severity: normal | Resolution: fixed Keywords: sprintsept14 | Triage Stage: Ready for Has patch: 1 | checkin Needs tests: 0 | Needs documentation: 0 Easy pickings: 0 | Patch needs improvement: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by mk.faraz@…):
* ui_ux: => 0 * easy: => 0 Comment: I used following code for this, just place it in views.py after import, offcourse you can replace direct_to_template to render_to_response in similar manner __direct_to_template = direct_to_template def __view_direct_to_template(*args, **kwargs): content_type = kwargs.pop('content_type', None) r = __direct_to_template(*args, **kwargs) if content_type: r['Content-Type'] = content_type return r direct_to_template = __view_direct_to_template -- Ticket URL: <https://code.djangoproject.com/ticket/1504#comment:17> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.