diff options
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index b5af9b6e6a..76f9246ca6 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -214,7 +214,7 @@ class HttpResponse(object): status_code = 200 - def __init__(self, content='', mimetype=None): + def __init__(self, content='', mimetype=None, status=None): from django.conf import settings self._charset = settings.DEFAULT_CHARSET if not mimetype: @@ -227,6 +227,8 @@ class HttpResponse(object): self._is_string = True self.headers = {'Content-Type': mimetype} self.cookies = SimpleCookie() + if status: + self.status_code = status def __str__(self): "Full HTTP message, including headers" |
