Skip to main content

Django template tag to load static files inline with your template.

Project description

https://travis-ci.org/bartTC/django-staticinline.svg?branch=master https://api.codacy.com/project/badge/Coverage/8e64345e99ea49888dc1bd9303c89a35 https://api.codacy.com/project/badge/Grade/8e64345e99ea49888dc1bd9303c89a35

django-staticinline

Similiar to Django’s static templatetag, but this includes the file directly in the template, rather than a link to it.

Example:

{% load staticinline %}

<style type="text/css">{% staticinline "myfile.css" %}</style>
<script>{% staticinline "myfile.js" %}</script>

Becomes:

<style type="text/css">body{ color: red; }</style>
<script>alert("Hello World");</script>

For further information and installation instructions see the docs on https://docs.elephant.house/django-staticinline/.

Changelog

(master)

  • Added support for Django 2.1 and Python 3.7.

  • Added proper documentation.

  • Added sri (Subresource Integrity) encoder to generate a sha256 for a given file.

v1.1 (2018-08-09)

  • Added support for custom data encoders to modify file content on the fly.

  • Added data and base64 encoders, both convert data into base64.

v1.0 (2018-04-29)

  • Initial release.

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-staticinline-1.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

django_staticinline-1.2-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-staticinline-1.2.tar.gz.

File metadata

  • Download URL: django-staticinline-1.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for django-staticinline-1.2.tar.gz
Algorithm Hash digest
SHA256 cdefc2c81bba1de87e6b355ff988ad7f03b3dce8429db06ee098ed435a5b56a3
MD5 3c0e8e84f7ae8ec6f7d17035b0020cae
BLAKE2b-256 49a15eb74efff7e06731b997854b4d2967bac7e0279ebc038065eebaa2da6a75

See more details on using hashes here.

Provenance

File details

Details for the file django_staticinline-1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: django_staticinline-1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for django_staticinline-1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a4800578f5984acfcd7b6f191c26468fb7783f013567e6bb1b7c733520c191ea
MD5 5f8000999f5f2cc3d6746a23baff7242
BLAKE2b-256 aefb7bbd8cec19af454a88e5f44188929ae4fe0fef7c9971b12b88fe7b2acf91

See more details on using hashes here.

Provenance

Supported by

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