summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 8e94626..fdb1be0 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: