Ticket #543: modpython.patch

File modpython.patch, 1.1 KB (added by sune.kirkeby@…, 19 years ago)
  • home/sune/django/django/utils/httpwrappers.py

     
    22from pprint import pformat
    33from urllib import urlencode
    44import datastructures
    5 from django.conf.settings import DEFAULT_MIME_TYPE
    65
    76class HttpRequest(object): # needs to be new-style class because subclasses define "property"s
    87    "A basic HTTP request"
     
    135134
    136135class HttpResponse:
    137136    "A basic HTTP response, with content and dictionary-accessed headers"
    138     def __init__(self, content='', mimetype=DEFAULT_MIME_TYPE):
     137    def __init__(self, content='', mimetype=None):
     138        if mimetype is None:
     139            from django.conf.settings import DEFAULT_MIME_TYPE
     140            mimetype = DEFAULT_MIME_TYPE
     141
    139142        self.content = content
    140         self.headers = {'Content-Type':mimetype}
     143        self.headers = {'Content-Type': mimetype}
    141144        self.cookies = SimpleCookie()
    142145        self.status_code = 200
    143146
Back to Top