diff --git a/basetheme_bootstrap/templatetags/sstatic.py b/basetheme_bootstrap/templatetags/sstatic.py index e0a5c7407d096afc2be09b9a96efced06f8b5ae9..493b7d2bff7b5674697f1161b2715f8a111cc228 100644 --- a/basetheme_bootstrap/templatetags/sstatic.py +++ b/basetheme_bootstrap/templatetags/sstatic.py @@ -10,13 +10,17 @@ from django.core.cache import cache register = template.Library() +__USE_ABSOLUT_URL_FOR_STATIC = getattr(settings, "USE_ABSOLUT_URL_FOR_STATIC", False) + @register.simple_tag(takes_context=True) def sstatic(context, path): url = cache.get(path) if url: return url - url = get_absolut_url(context["request"], compute_url_for_path(path)) + url = compute_url_for_path(path) + if __USE_ABSOLUT_URL_FOR_STATIC: + url = get_absolut_url(context["request"], url) cache.set(path, url, None) return url diff --git a/setup.py b/setup.py index da888db0e3ddf4007c7a40764c936d343d9a7e35..67bf2f68b64def66e22cea06d41a8c0bd5348a4e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ readme = open('README.rst').read() setup( name='django-basetheme-bootstrap', - version='0.2.45', + version='0.2.46', description='Django Basetheme Bootstrap', long_description=readme, author='Bryan Brancotte',