
IT/파이썬 2023. 4. 26.
Django - response 객체에 쿼리스트링 추가
response 보낼때 쿼리 스트링 붙여서 보내고 싶다면, 아래 코드를 참고하세요. response = redirect("order_view", pk=order.id) response["Location"] += "?" + request.POST.get("querystring") return response Location 이라는 필드가 있는 지 어케 아는지? 이렇게 작성을 해도 되고, from django.http import HttpResponse def my_view(request): # Get the query string from the request query_string = request.GET.get("querystring") # Create the URL with the query stri..
