Ejemplo n.º 1
0
def static(url):
    resource_url = url
    version = resource_versions.get(resource_url)
    url = settings.STATIC_URL + url
    if version:
        url += "?version=%s" % version
    return url
Ejemplo n.º 2
0
def static(url):
    resource_url = url
    version = resource_versions.get(resource_url)
    url = settings.STATIC_CDN + settings.STATIC_URL + url
    is_less = url.endswith(".less")
    if version and not is_less:
        url += "?version=%s" % version
    return url
Ejemplo n.º 3
0
def static(url):
    resource_url = url
    version = resource_versions.get(resource_url)
    url = settings.STATIC_CDN + settings.STATIC_URL + url
    is_less = url.endswith('.less')
    if version and not is_less:
        url += "?version=%s" % version
    return url
Ejemplo n.º 4
0
def static(url):
    resource_url = url
    if "hq_bootstrap" in url:
        resource_url = resource_url.replace("/css/", "/less/").replace(".css", ".less").replace("hq_bootstrap/", "hq-bootstrap/")
    version = resource_versions.get(resource_url)
    url = settings.STATIC_URL + url
    if version:
        url += "?version=%s" % version
    return url
Ejemplo n.º 5
0
def new_static(url, **kwargs):
    """Caching must explicitly be defined on tags with any of the extensions
    that could be compressed by django compressor. The static tag above will
    eventually turn into this tag.
    :param url:
    :param kwargs:
    :return:
    """
    can_be_compressed = url.endswith(('.less', '.css', '.js'))
    use_cache = kwargs.pop('cache', False)
    use_versions = not can_be_compressed or use_cache

    resource_url = url
    url = settings.STATIC_URL + url
    if use_versions:
        version = resource_versions.get(resource_url)
        if version:
            url += "?version=%s" % version

    return url
Ejemplo n.º 6
0
def new_static(url, **kwargs):
    """Caching must explicitly be defined on tags with any of the extensions
    that could be compressed by django compressor. The static tag above will
    eventually turn into this tag.
    :param url:
    :param kwargs:
    :return:
    """
    can_be_compressed = url.endswith(('.less', '.css', '.js'))
    use_cache = kwargs.pop('cache', False)
    use_versions = not can_be_compressed or use_cache

    resource_url = url
    url = settings.STATIC_URL + url
    if use_versions:
        version = resource_versions.get(resource_url)
        if version:
            url += "?version=%s" % version

    return url
Ejemplo n.º 7
0
def cachebuster(url):
    return resource_versions.get(url, "")
Ejemplo n.º 8
0
def cachebuster(url):
    return resource_versions.get(url, "")