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.

Source Distribution

django-template-shortcuts-0.2.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

django_template_shortcuts-0.2.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

django_template_shortcuts-0.2.2-py2-none-any.whl (7.4 kB view details)

Uploaded Python 2

File details

Details for the file django-template-shortcuts-0.2.2.tar.gz.

File metadata

File hashes

Hashes for django-template-shortcuts-0.2.2.tar.gz
Algorithm Hash digest
SHA256 eaf4ca9df3ef1e2b45cec0a78aa8137e983a64206b6d82820969686d0f0b52c1
MD5 ca1eba634ec3fba5d9a11bfab735a113
BLAKE2b-256 7078971f752239da1a7fe9459e811a0b21e365239eacb40ed32758a59cc034d5

See more details on using hashes here.

File details

Details for the file django_template_shortcuts-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_template_shortcuts-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e666d4ceadbc0e183f2bd0a5c7223df1bcc0f63b5dade39674f8a22fa4bc8bc
MD5 1a3d8c472a7ee2f9986fb4a75315900f
BLAKE2b-256 567bea42f9e6a23f930593229cfc7a1bb386949d3f3f918a5b9bab97b3f0f0ed

See more details on using hashes here.

File details

Details for the file django_template_shortcuts-0.2.2-py2-none-any.whl.

File metadata

File hashes

Hashes for django_template_shortcuts-0.2.2-py2-none-any.whl
Algorithm Hash digest
SHA256 ebc90c5e12705b467ffc61f78741daf32da71d29f60a84c1d526e7a1569c0eb5
MD5 051c4e273bd63fcb3299797db28a8d57
BLAKE2b-256 e80f042c94457d3e13077816311cd32e0daf1f86212c4408ad4647db6ae10f03

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page