What about 2 settings files, for the different instances? One for HTTP and one for HTTPS?
You can partially override settings by doing something like this:
from foo.settings.prod import *
# Add local overrides here
Regards,
Nickolas
On Monday, 6 August 2012 07:34:40 UTC+2, Mark Gemmill wrote:
I've been tackling the problem of serving both the frontend (http) and the admin (https) site of a Django application from a single instance of the application.
I ran a successful test on webfaction serving the application with nginx+gunicorn and having nginx take care of redirecing /admin urls to https. So far, so
good, except that the sites STATIC_URL is either http or https and then I run into browsers not playing nice with mixed content.
It seems to me that if I could somehow arrange for the STATIC_URL to dynamically adjust itself to use https:// when Django handles a request that is secured,
then the problem would go away. I tried just setting the context value of STATIC_URL in a template context processor function, but templates that use the 'static' template
tag are not effected by this trick. Is there another way this can be accomplished?