Re: [Django] #1504: Allow render_to_response() to take a content-type param

5 views
Skip to first unread message

Django

unread,
Nov 20, 2012, 4:08:54 PM11/20/12
to django-...@googlegroups.com
#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.

Django

unread,
Jun 16, 2014, 3:28:26 AM6/16/14
to django-...@googlegroups.com
#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
-------------------------------------+-------------------------------------

Comment (by anonymous):

fucking jesus god, bullshit.

why not just do the enhancement?

--
Ticket URL: <https://code.djangoproject.com/ticket/1504#comment:18>

Reply all
Reply to author
Forward
0 new messages