Zubair Afzal
Zubair Afzal

Reputation: 2086

Django changing rendered url in a view

I want to change the display URL of a rendered response object. I have a single view "view1" and it is called by a URL, "localhost/foo/view1" . On some condition in view1 I want to change rendered URL to be displayed on browser to "localhost/foo/other/view1". I don't want to use HttpResponseRedirect. I only want to change the display URL in browser when the requested page is rendered.

Upvotes: 3

Views: 2222

Answers (2)

ryanshow
ryanshow

Reputation: 562

It's possible with the html5 history api, http://html5demos.com/history

Upvotes: 1

DrTyrsa
DrTyrsa

Reputation: 31981

No way you can do that. It would be phishing paradise if anyone could change the URL without redirecting.

Use redirects instead.

Upvotes: 4

Related Questions