Get current URL in Python

前端 未结 7 2071
独厮守ぢ
独厮守ぢ 2020-12-05 18:49

How would i get the current URL with Python,

I need to grab the current URL so i can check it for query strings e.g

requested_url = \"URL_HERE\"

ur         


        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 19:00

    For anybody finding this via google,

    i figured it out,

    you can get the query strings on your current request using:

    url_get = self.request.GET
    

    which is a UnicodeMultiDict of your query strings!

提交回复
热议问题