Skip to content

lowks/django-template-shortcuts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-template-shortcuts

Build Status Latest Version Downloads

Remove boilerplate code when including JS and CSS files hosted by popular CDNs.

Index

Instalation

Via pip:

    pip install django-template-shortcuts

Via easy_install:

    easy_install django-template-shortcuts

Clonning the project:

    $ git clone git://github.com/comandrei/django-template-shortcuts.git
    $ python django-template-shortcuts/setup.py install

Add the app to your installed apps:

    INSTALLED_APPS = (
        ...
        'template_shortcuts',
        ...
    )
	TEMPLATE_CDN_PROVIDER = "template_shortcuts.providers.google.Google"

There is support for multiple CDN backends and multiple JS libraries. Currently only the Google CDN is supported with some support for Cloudfare's CDNJS.

Usage

	{% load shortcuts %}
	{% jquery "1.7.2" %}

Will yeild

	<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

Supported libraries

Template Tag Google CDNJS
angular
chrome_frame
dojo
ext_core
jquery
jquery_ui
mootools
modernizr
prototype
scriptaculos
webfont

Contributing

Found an issue or just want to add some functionality? Open an issue in the issue tracker on github, fork the project, hack away, and make a pull request when you're done.

About

Reusable Django templatetags

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%