Praveen Singh Yadav
Praveen Singh Yadav

Reputation: 1861

Python read current url to store it session for later comeback

I am on url : /main/a=11&b=22

I want to store this in my session to come back to this page later

How can fetch this url with all the parmeters like this.

url = fetch_function(currnet_url) 
print url 
/main/a=11&b=22
request.session['url'] = url

Upvotes: 1

Views: 376

Answers (1)

Bogdan Iulian Bursuc
Bogdan Iulian Bursuc

Reputation: 2275

Use request.get_full_path() method. Read more here: https://docs.djangoproject.com/en/1.6/ref/request-response/#django.http.HttpRequest.get_full_path

Upvotes: 3

Related Questions