diff options
-rw-r--r-- | local_settings.py.example | 5 | ||||
-rw-r--r-- | main/templatetags/cdn.py | 7 |
2 files changed, 3 insertions, 9 deletions
diff --git a/local_settings.py.example b/local_settings.py.example index beb48f84..bad03921 100644 --- a/local_settings.py.example +++ b/local_settings.py.example @@ -53,8 +53,7 @@ SECRET_KEY = '00000000000000000000000000000000000000000000000' ## CDN settings CDN_ENABLED = False -CDN_PATH = 'http://example.com/path/' -CDN_PATH_SECURE = 'https://example.com/path/' - +# Scheme-relative URL, should work for both http/https +CDN_PATH = '//example.com/path/' # vim: set ts=4 sw=4 et: diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py index c25040c0..5cb12fcf 100644 --- a/main/templatetags/cdn.py +++ b/main/templatetags/cdn.py @@ -23,12 +23,7 @@ class CDNPrefixNode(template.Node): oncdn = getattr(settings, 'CDN_ENABLED', True) if not oncdn: return '' - secure = 'secure' in context and context['secure'] # if left undefined, same behavior as if CDN is turned off - paths = { - False: getattr(settings, 'CDN_PATH', ''), - True: getattr(settings, 'CDN_PATH_SECURE', ''), - } - return paths[secure] + return getattr(settings, 'CDN_PATH', '') # vim: set ts=4 sw=4 et: |