Skip to main content

Reusable Django templatetags

Project description

django-template-shorcuts

CI Version Downloads

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

Requirements

Core

  • Python 2.7+ or Python 3.3+
  • Django 1.7 through Django 1.9

Installation

pip install django-template-shorcuts

Add to your installed apps in settings

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>

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-template-shortcuts, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size django_template_shortcuts-0.2.2-py2-none-any.whl (7.4 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size django_template_shortcuts-0.2.2-py3-none-any.whl (7.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-template-shortcuts-0.2.2.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page