开发者

Append value from cookie to URL in Django

开发者 https://www.devze.com 2023-01-23 17:22 出处:网络
I have a value the user sets via a cookie and I want this va开发者_StackOverflow社区lue to be appended onto the URL after the user sets it.How can I enable this?Any ideas are welcome as I\'m not so su

I have a value the user sets via a cookie and I want this va开发者_StackOverflow社区lue to be appended onto the URL after the user sets it. How can I enable this? Any ideas are welcome as I'm not so sure how to go about this.


This seems like an ineffective solution, but what if you write a view to check for the existance of the cookie, if it doesn't exist let them set it. If it does exist, HttpRedirect them to url + cookie-value. And add a line in your urls.py to match those urls.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号