From 943ef2e8e436a32ce5dc956c4d855866cd644cc1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 5 Dec 2011 23:06:10 -0600 Subject: Convert to and enable staticfiles contrib application This moves our site static files into the sitestatic directory if they are shared resources, and also moves a handful of things (such as the artwork logos) into application-specific static/ directories. This allows the staticfiles contrib app to work after a few settings tweaks, a run of collectstatic, and massaging the hardcoded '/media/' prefix out of our templates. Django 1.4 is going to make this a lot easier to move things to a CDN and provides better template tags; for now this is setting the stage before we can move to that. Signed-off-by: Dan McGee --- main/templatetags/cdn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/templatetags') diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py index 5cb12fc..b91553e 100644 --- a/main/templatetags/cdn.py +++ b/main/templatetags/cdn.py @@ -11,7 +11,8 @@ def jquery(): link = 'https://ajax.googleapis.com/ajax/libs/jquery/' \ '%s/jquery.min.js' % version else: - link = '/media/jquery-%s.min.js' % version + static_url = getattr(settings, 'STATIC_URL', '/static/') + link = '%sjquery-%s.min.js' % (static_url, version) return '' % link @register.tag -- cgit v1.2.3-24-g4f1b