Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit 'paltman/master'

  • Loading branch information...
commit 66f3c98df2fefd4ac1eb0cc04f6be35ac6a05712 2 parents d738ccd + 26e2099
@pelme pelme authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  compress/templatetags/compressed.py
  2. +3 −1 compress/utils.py
View
3  compress/templatetags/compressed.py
@@ -14,10 +14,11 @@ def render_common(template_name, obj, filename, version):
filename = get_output_filename(filename, version)
context = obj.get('extra_context', {})
+ prefix = context.get('prefix', None)
if filename.startswith('http://'):
context['url'] = filename
else:
- context['url'] = media_url(filename)
+ context['url'] = media_url(filename, prefix)
return template.loader.render_to_string(template_name, context)
View
4 compress/utils.py
@@ -60,7 +60,9 @@ def media_root(filename):
"""
return os.path.join(django_settings.MEDIA_ROOT, filename)
-def media_url(url):
+def media_url(url, prefix=None):
+ if prefix:
+ return prefix + urlquote(url)
return django_settings.MEDIA_URL + urlquote(url)
def concat(filenames, separator=''):
Please sign in to comment.
Something went wrong with that request. Please try again.