Serving secure Django pages with HTTPS

后端 未结 1 737
小鲜肉
小鲜肉 2020-12-31 17:46

What is the proper deployment configuration for a Django application that needs some pages served with HTTPS and others with HTTP? I want to use HTTPS for the pages that inv

相关标签:
1条回答
  • 2020-12-31 18:23

    There's no single approach as far as I know. You can use a decorator secure_required as developed in this post by Scott Barnham:

    • Securing Django with SSL

    or use middleware:

    • SSLMidleware

    If you're looking for deployment information with respect to Apache and mod_wsgi, then Graham Dumpleton provides a nice answer in this question:

    • How to force the use of SSL for some URL of my Django Application ?
    0 讨论(0)
提交回复
热议问题