summaryrefslogtreecommitdiff
path: root/django/http/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/http/__init__.py')
-rw-r--r--django/http/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index bb03ab8ea5..178510c94c 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -265,6 +265,12 @@ class HttpResponseForbidden(HttpResponse):
HttpResponse.__init__(self, *args, **kwargs)
self.status_code = 403
+class HttpResponseNotAllowed(HttpResponse):
+ def __init__(self, permitted_methods):
+ HttpResponse.__init__(self)
+ self['Allow'] = ', '.join(permitted_methods)
+ self.status_code = 405
+
class HttpResponseGone(HttpResponse):
def __init__(self, *args, **kwargs):
HttpResponse.__init__(self, *args, **kwargs)