Skip to content

Instantly share code, notes, and snippets.

@daaray
Created June 28, 2012 19:58
Show Gist options
  • Save daaray/3013502 to your computer and use it in GitHub Desktop.
Save daaray/3013502 to your computer and use it in GitHub Desktop.
{% with foo="http:://domain.com"|add:STATIC_URL|add:"path/to/image.jpg" %}
{{ foo }}
{% endwith %}
@mlavin
Copy link

mlavin commented Jun 28, 2012

If you are using 1.4 the static tag might be better here: https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#static

@daaray
Copy link
Author

daaray commented Jun 28, 2012

Ah! Thanks! Was thinking I'd have to write a context processor to grab the Site URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment