
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..

IT/리눅스 2021. 6. 2.
우분투 Nginx - 동일 포트 http 접근 https 리다이렉트
포트가 다른 경우에는 그냥 리다이렉트 하면 되는데. 비표준 포트를 사용하는 경우, http 로 접근했을 때 같은 포트의 https 로 보내 주고 싶다. 비슷한 고민이 있던 다른이들의 흔적을 찾음 :) [nginx] 같은 포트로 들어오는 http를 https 로 넘기기 https://blog.bandoche.com/622 질문 이걸 해결하기 위해 구글링. Force redirect to https on specific port on nginx? 질문 자체를 가져와 봤다. 한글로 써 놓기 쉽지 않네. 내용은 아래와 같은 질문이다. 나랑 똑같은 고민 I have website on port 8080 and I want to force https on it. ex. If I type http://mywebsit..