[Django]-Django-http-proxy prepending slash

4👍

Since no one answered (I even got a badge because no one answered, how cool is that?), I will post my solution, which was solved 2 days after the question was asked.

1 – Because of this issue pointed out by a friend, I have steered away from using django-http-proxy.

2 – So I resorted to a better library which proxies all HTTP Methods, unlike django-http-proxy that can only proxy GET. Meet django-revproxy.

3 – Which introduces another problem — The Cookie Conflict. This happens because I have two django instances. The solution is to explicitly declare the cookie path in one of your django app so it won’t be using the same path. Just add in settings.py these two lines:

SESSION_COOKIE_NAME = "yourApp_session_id"
CSRF_COOKIE_NAME =  "yourApp_csrftoken"

4 – That’s it. I hope this solution will help those on the lookout.

Leave a comment