I have a url of a type where query string is like this… ?
next=/contact/200/10626096&back%3DZHViYWkuZHViaXp6bGUubmxoL2NsYXNzaWZpZWQvYXV0b3M0eDRzL2Fjd>XJhL2NzeGVsLz95ZWFyX19ndGU9JmFkZGVkX19ndGU9JnNlbGxlcl90eXBlPSZpc19zZWFyY2g9MSZraWxvbWV0ZXJz>X19ndGU9JnByaWNlX19ndGU9JnBsYWNlc19faWRfX2luPUVudGVyK0xvY2F0aW9uJTI4cyUyOStIZXJlJnBsYWNlc19>faWRfX2luPSZ5ZWFyX19sdGU9MjAxMiZraWxvbWV0ZXJzX19sdGU9JmtleXdvcmRzPSZpc19iYXNpY19zZWFyY2hfd2>lkZ2V0PTAmcHJpY2VfX2x0ZT0%3D
I am getting this url in my backend code using request.META.get('HTTP_REFERER')
as this one is my referer url not the current one so I can’t use request.get_full_path.
Now I just want the value of next from it which is /contact/200/10626096 but the problem is that I can’t use request.GET.get('next') as it is not the current url.
I don’t want to use split('?next=') type of solutions as I am looking for more pythonic solutions like request.GET.get('next')
1 Answer