Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving secure Django pages with HTTPS

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 involve registration and inputting passwords. I want to use HTTP for all other pages.

like image 552
hekevintran Avatar asked Aug 09 '10 17:08

hekevintran


1 Answers

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 ?
like image 93
ars Avatar answered Oct 05 '22 13:10

ars