How to force the use of SSL for some URL of my Django Application?

前端 未结 4 1022
北海茫月
北海茫月 2020-12-08 12:20

I want to be sure that for some URL of my website, SSL will be use. I saw a lot of answer already on SO.

Force redirect to SSL for all pages apart from one

S

4条回答
  •  孤街浪徒
    2020-12-08 12:38

    We used some simple middleware to check urls against a list of base urls that must be in HTTPS mode, all others are forced to HTTP mode. The big caveat here is that any POST data can be lost unless you take extra care (it didn't matter in our case). We were doing this on join pages that required credit card numbers and the like so as soon as they were in that pipeline we forced them into HTTPS.

提交回复
热议问题