summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-05-14 17:00:23 -0500
committerDan McGee <dan@archlinux.org>2010-05-14 17:00:23 -0500
commit0bdcc7ded06e260982a2f374318fb9abb51ff6e0 (patch)
tree423c17b4d5ad34bf3ae76050f92d7706ba062590
parent4b7335f7137c587e775013d49bccc28bc32387c8 (diff)
Make CDN not dependent on DEBUG setting
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/templatetags/cdn.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index 8e946265..fdb1be07 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -10,10 +10,11 @@ def jquery(parser, token):
class JQueryNode(template.Node):
def render(self, context):
version = '1.4.2'
- if getattr(settings, 'DEBUG', True):
- jquery = '/media/jquery-%s.min.js' % version
- else:
+ oncdn = getattr(settings, 'CDN_ENABLED', True)
+ if oncdn:
jquery = 'http://ajax.googleapis.com/ajax/libs/jquery/%s/jquery.min.js' % version
+ else:
+ jquery = '/media/jquery-%s.min.js' % version
return '<script type="text/javascript" src="%s"></script>' % jquery
# vim: set ts=4 sw=4 et: