Changes between Initial Version and Version 3 of Ticket #24598


Ignore:
Timestamp:
Apr 8, 2015, 7:50:49 AM (10 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24598 – Description

    initial v3  
    1 By default when a content_type is not passed to HttpResponse it will create one from settings.DEFAULT_CONTENT_TYPE, and attach the encoding.
     1By default when a content_type is not passed to `HttpResponse` it will create one from `settings.DEFAULT_CONTENT_TYPE`, and attach the encoding.
    22
    33So, when unspecified, the header will appear as:
     
    77}}}
    88
    9 However, if you specify the content_type, this action is no taken.
     9However, if you specify the `content_type`, this action is not taken.
    1010
    11 That's understandable in a "consenting adults" context, however the JsonResponse sets content_type using kwargs.setdefault, thus forcing the loss of encoding annotation in all responses.
     11That's understandable in a "consenting adults" context, however the `JsonResponse` sets `content_type` using `kwargs.setdefault`, thus forcing the loss of encoding annotation in all responses.
    1212
    13 I propose instead that HttpResponseBase check for a ``default_content_type`` property to override settings.DEFAULT_CONTENT_TYPE, thus:
     13I propose instead that `HttpResponseBase` check for a `default_content_type` property to override `settings.DEFAULT_CONTENT_TYPE`, thus:
    1414
    1515
    1616{{{
     17#!diff
    1718diff --git a/django/http/response.py b/django/http/response.py
    1819index c8d6930..40186b5 100644
Back to Top