Re: serving over either 80 or 443

2017-07-20 Thread Larry Martell
On Thu, Jul 20, 2017 at 1:27 AM, James Schneider wrote: > > > On Jul 19, 2017 1:56 PM, "Larry Martell" wrote: > > This is probably not strictly a Django question, but I'm hoping > someone here has had to solve this before. > > We have a django

Re: serving over either 80 or 443

2017-07-20 Thread Larry Martell
On Wed, Jul 19, 2017 at 5:14 PM, François Schiettecatte wrote: > This tells you whether the request is secure or not: > > > https://docs.djangoproject.com/en/1.11/ref/request-response/#django.http.HttpRequest.is_secure Thanks I did not know about that. > You

Re: serving over either 80 or 443

2017-07-20 Thread 'Tom Evans' via Django users
On Wed, Jul 19, 2017 at 9:55 PM, Larry Martell wrote: > This is probably not strictly a Django question, but I'm hoping > someone here has had to solve this before. > > We have a django app that is sometimes deployed in an environment with > SSL and talks over port 443,

Re: serving over either 80 or 443

2017-07-19 Thread James Schneider
On Jul 19, 2017 1:56 PM, "Larry Martell" wrote: This is probably not strictly a Django question, but I'm hoping someone here has had to solve this before. We have a django app that is sometimes deployed in an environment with SSL and talks over port 443, and other times

Re: serving over either 80 or 443

2017-07-19 Thread François Schiettecatte
This tells you whether the request is secure or not: https://docs.djangoproject.com/en/1.11/ref/request-response/#django.http.HttpRequest.is_secure You could set a flag in the context you pass your templates. And what about stripping 'https://0.0.0.0:443/‘ from the url, just use

serving over either 80 or 443

2017-07-19 Thread Larry Martell
This is probably not strictly a Django question, but I'm hoping someone here has had to solve this before. We have a django app that is sometimes deployed in an environment with SSL and talks over port 443, and other times is deployed in a non-SSL environment and talks over port 80. In our