summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-24 19:12:02 +0100
committerDan McGee <dan@archlinux.org>2012-03-24 19:12:02 +0100
commit5888bdf0db3aaa38f35f4630af86edf4b07f65e2 (patch)
tree47ba5f7809d9200500f8ee807bb93b3bdf410f8f /main
parent99a0e1bc76295243026ffbd41af10d62787b9ec0 (diff)
downloadarchweb-5888bdf0db3aaa38f35f4630af86edf4b07f65e2.tar.gz
archweb-5888bdf0db3aaa38f35f4630af86edf4b07f65e2.tar.xz
Use staticfiles_storage in jQuery tag
To get the local URL to the jQuery JS file. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/templatetags/cdn.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index f290a52..ab5d881 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -1,8 +1,10 @@
from django import template
from django.conf import settings
+from django.contrib.staticfiles.storage import staticfiles_storage
register = template.Library()
+
@register.simple_tag
def jquery():
version = '1.4.4'
@@ -11,8 +13,8 @@ def jquery():
link = 'https://ajax.googleapis.com/ajax/libs/jquery/' \
'%s/jquery.min.js' % version
else:
- static_url = getattr(settings, 'STATIC_URL', '/static/')
- link = '%sjquery-%s.min.js' % (static_url, version)
+ filename = 'jquery-%s.min.js' % version
+ link = staticfiles_storage.url(filename)
return '<script type="text/javascript" src="%s"></script>' % link
# vim: set ts=4 sw=4 et: