Reputation: 6003
I am using django to dev a website. I need to get the url (location) from the redirect response, but can't find any method or attr.
Traceback (most recent call last):
File "/opt/python27/lib/python2.7/site-packages/django/core/handlers/base.py", line 223, in get_response
response = middleware_method(request, response)
File "/opt/dbinabox/DBInBoxWeb/dbinabox/dbasrm/altus.py", line 16, in process_response
print response.header
AttributeError: 'HttpResponseRedirect' object has no attribute 'header'
Upvotes: 2
Views: 1159
Reputation: 47364
Try response.url
. From the docs:
This read-only attribute represents the URL the response will redirect to (equivalent to the Location response header).
Upvotes: 4