Coder Social home page Coder Social logo

canonical / canonicalwebteam.versioned-static Goto Github PK

View Code? Open in Web Editor NEW
4.0 20.0 4.0 30 KB

A {% versioned_static %} template tag for generating cache-busting static URLs

License: GNU Lesser General Public License v3.0

Python 100.00%
package web-and-design

canonicalwebteam.versioned-static's Introduction

canonical-webteam.versioned-static

A {% versioned_static %} Django template tag for generating a URL for a static file, with a version string which will be effectively unique based on the contents of the file.

Example

/static/css/global.css?v=a23bd10

Installation

# settings.py
INSTALLED_APPS += ['django_versioned_static_url']

Usage

The following template code:

{% load versioned_static %}
<link rel="stylesheet" href="{% versioned_static 'css/global.css' %}" />

Outputs:

<link rel="stylesheet" href="/static/css/global.css?v=feb0d0e" />

canonicalwebteam.versioned-static's People

Contributors

jkfran avatar nottrobin avatar willmoggridge avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canonicalwebteam.versioned-static's Issues

Flask support

Provide this as a Jinja2 template tag for Flask applications.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined

Produce 404 rather than server error

If a static file is missing, leads to a server error:

  File "/usr/local/lib/python2.7/dist-packages/django_versioned_static_url/templatetags/versioned_static.py", line 21, in versioned_static
    with open(full_path) as file_contents:
TypeError: coercing to Unicode: need string or buffer, list found

This should be a 404 instead.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update actions/checkout action to v2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.