Ticket #19205: 0001-make-render_to_response-docs-refer-to-content_type-n.patch

File 0001-make-render_to_response-docs-refer-to-content_type-n.patch, 1.9 KB (added by Jim Garrison, 12 years ago)
  • docs/topics/http/shortcuts.txt

    From a0bd24f2f05f794933850ed45c6fc480c3efa084 Mon Sep 17 00:00:00 2001
    From: Jim Garrison <garrison@wikiotics.org>
    Date: Sat, 27 Oct 2012 19:09:56 -0700
    Subject: [PATCH] make render_to_response() docs refer to content_type, not
     mimetype
    
    ---
     docs/topics/http/shortcuts.txt |    8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt
    index 0dc38b1..c8f2c69 100644
    a b This example is equivalent to::  
    8787``render_to_response``
    8888======================
    8989
    90 .. function:: render_to_response(template_name[, dictionary][, context_instance][, mimetype])
     90.. function:: render_to_response(template_name[, dictionary][, context_instance][, content_type])
    9191
    9292   Renders a given template with a given context dictionary and returns an
    9393   :class:`~django.http.HttpResponse` object with that rendered text.
    Optional arguments  
    121121                                  my_data_dictionary,
    122122                                  context_instance=RequestContext(request))
    123123
    124 ``mimetype``
     124``content_type``
    125125    The MIME type to use for the resulting document. Defaults to the value of
    126126    the :setting:`DEFAULT_CONTENT_TYPE` setting.
    127127
    MIME type :mimetype:`application/xhtml+xml`::  
    136136    def my_view(request):
    137137        # View code here...
    138138        return render_to_response('myapp/index.html', {"foo": "bar"},
    139             mimetype="application/xhtml+xml")
     139            content_type="application/xhtml+xml")
    140140
    141141This example is equivalent to::
    142142
    This example is equivalent to::  
    148148        t = loader.get_template('myapp/template.html')
    149149        c = Context({'foo': 'bar'})
    150150        return HttpResponse(t.render(c),
    151             mimetype="application/xhtml+xml")
     151            content_type="application/xhtml+xml")
    152152
    153153``redirect``
    154154============
Back to Top