Ticket #543: modpython.patch
File modpython.patch, 1.1 KB (added by , 19 years ago) |
---|
-
home/sune/django/django/utils/httpwrappers.py
2 2 from pprint import pformat 3 3 from urllib import urlencode 4 4 import datastructures 5 from django.conf.settings import DEFAULT_MIME_TYPE6 5 7 6 class HttpRequest(object): # needs to be new-style class because subclasses define "property"s 8 7 "A basic HTTP request" … … 135 134 136 135 class HttpResponse: 137 136 "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 139 142 self.content = content 140 self.headers = {'Content-Type': mimetype}143 self.headers = {'Content-Type': mimetype} 141 144 self.cookies = SimpleCookie() 142 145 self.status_code = 200 143 146