aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/views.py
diff options
context:
space:
mode:
authorTom Christie2012-02-21 06:09:30 -0800
committerTom Christie2012-02-21 06:09:30 -0800
commit49ebaf106d4c4357f51f6b2bbe533512340ea113 (patch)
treeddb6cb637899a327253bffc2888e376eeab4e9f1 /djangorestframework/views.py
parent5a5f24f263c218f4f04a6ea54bfc48a2794e152b (diff)
parentf17f3886f42c2068e6e8a41c6e5fe6bfe1408add (diff)
downloaddjango-rest-framework-49ebaf106d4c4357f51f6b2bbe533512340ea113.tar.bz2
Merge pull request #175 from izquierdo/custom_reverse
Custom reverse() and drop set_script_prefix
Diffstat (limited to 'djangorestframework/views.py')
-rw-r--r--djangorestframework/views.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py
index 32d2437c..3e8bf356 100644
--- a/djangorestframework/views.py
+++ b/djangorestframework/views.py
@@ -181,20 +181,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
Required if you want to do things like set `request.upload_handlers` before
the authentication and dispatch handling is run.
"""
- # Calls to 'reverse' will not be fully qualified unless we set the
- # scheme/host/port here.
- self.orig_prefix = get_script_prefix()
- if not (self.orig_prefix.startswith('http:') or self.orig_prefix.startswith('https:')):
- prefix = '%s://%s' % (request.is_secure() and 'https' or 'http', request.get_host())
- set_script_prefix(prefix + self.orig_prefix)
+ return request
def final(self, request, response, *args, **kargs):
"""
Hook for any code that needs to run after everything else in the view.
"""
- # Restore script_prefix.
- set_script_prefix(self.orig_prefix)
-
# Always add these headers.
response.headers['Allow'] = ', '.join(self.allowed_methods)
# sample to allow caching using Vary http header