Home  >  Q&A  >  body text

python - django uses redirect to jump to the web page, how to pass the referer to the target web page

As shown below, when developing and logging in, the referer address of the http request that jumps to WeChat must be consistent with the backend.

I use django's return redirect(url) to jump to the WeChat login interface. WeChat cannot get the referer address. I want to know how to pass this referer address?

If you create a login hyperlink to the WeChat login interface, you can have a referer at this time, but I want to automatically go to the WeChat login interface when the user is not logged in. Looking for a solution

为情所困为情所困2712 days ago927

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-18 10:52:32

    META in request actually contains a lot of information, one of which is HTTP_REFERER
    You can request.META.get('HTTP_REFERER') to get the referer address

    reply
    0
  • Cancelreply