Permalink
Browse files

Merge commit 'paltman/master'

  • Loading branch information...
2 parents d738ccd + 26e2099 commit 66f3c98df2fefd4ac1eb0cc04f6be35ac6a05712 @pelme pelme committed Mar 10, 2009
Showing with 5 additions and 2 deletions.
  1. +2 −1 compress/templatetags/compressed.py
  2. +3 −1 compress/utils.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
@@ -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=''):

0 comments on commit 66f3c98

Please sign in to comment.