Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:06:56+00:00 2026-05-25T21:06:56+00:00

My site uses a sub-domain to serve static content (static.example.com). Therefore, STATIC_URL must be

  • 0

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).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:06:56+00:00Added an answer on May 25, 2026 at 9:06 pm

    I went with the scheme-less URLs for STATIC_URL and MEDIA_URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A site uses this link format for everything: example.com/?article=123 example.com/?category=456 example.com/?article=789&picture=012 An ASP classic
Some sites use a separate domain for images the site uses, for example YouTube
I'm developing a site using Wordpress which uses Categories for main sections with sub
We have a web site in the domain, let's name: http://website.com . It is
My site uses the Google Maps API . In situations where the connection to
I currently have a site which uses a MySQL 4.x schema, the site uses
The navigation on the left menu in the below site uses CSS for mouseover
I have a site that uses a couple DropDownLists that are databound. I was
I have a site that uses a large centered background image, which naturally loads
My current site ( VisualHint ) uses ExpressionEngine and allows me to have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.