My site uses a sub-domain to serve static content (static.example.com). Therefore, STATIC_URL must be an absolute URL. The STATIC_URL, {% get_static_prefix %}, MEDIA_URL, etc. should use the https:// scheme when the request is secure.
What is the typical way to reference the the static content URL in a template with a scheme that matches the request?
If there isn’t anything built-in I’ll just replace django.core.context_processors.static with my own context processor that uses is_secure(). But, I figured this is common enough that there must be a “conventional” way of dealing with this. Perhaps this is how people normally do it?
I have Django 1.3/nginx/mod_wsgi configured properly such that Django knows when the request is over SSL using request.is_secure().
I want to avoid scheme-less URLs (due to IE double-download) and middleware (seems like overkill).
I went with the scheme-less URLs for
STATIC_URLandMEDIA_URL.