Best way to get query string from a URL in python?

后端 未结 3 858
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 02:22

I need to get the query string from this URL https://stackoverflow.com/questions/ask?next=1&value=3 and I don\'t want to use request.META. I have figured out that there

3条回答
  •  抹茶落季
    2020-12-09 03:15

    I prefer using

    request.META['QUERY_STRING']
    

    From docs:

    https://docs.djangoproject.com/en/stable/ref/request-response/#django.http.HttpRequest.META

    This does not include the ? prefix.

提交回复
热议问题