Metadata-Version: 2.1
Name: django-staticinline
Version: 1.3
Summary: Django template tag to load static files inline with your template.
Home-page: https://github.com/bartTC/django-staticinline
Author: Martin Mahner
Author-email: martin@mahner.org
License: MIT
Keywords: django,staticfiles,inline,performance
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Framework :: Django
Provides-Extra: test
Requires-Dist: django (>=1.8)
Provides-Extra: test
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-django; extra == 'test'
Provides-Extra: test
Requires-Dist: mock; (python_version < "3") and extra == 'test'

.. image:: https://travis-ci.org/bartTC/django-staticinline.svg?branch=master
    :target: https://travis-ci.org/bartTC/django-staticinline

.. image:: https://api.codacy.com/project/badge/Coverage/8e64345e99ea49888dc1bd9303c89a35
    :target: https://www.codacy.com/app/bartTC/django-staticinline?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=bartTC/django-staticinline&amp;utm_campaign=Badge_Coverage

.. image:: https://api.codacy.com/project/badge/Grade/8e64345e99ea49888dc1bd9303c89a35
    :target: https://www.codacy.com/app/bartTC/django-staticinline?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=bartTC/django-staticinline&amp;utm_campaign=Badge_Grade

.. note:: 📖 You find the full documentation on
          https://docs.elephant.house/django-staticinline/.

===================
django-staticinline
===================

Works similar to Django's ``static`` templatetag, but this one includes
the file directly in the template, rather than a link to it.

You can additionally post-process the file content using custom 'encoder'.

Quickstart
==========

1. Put the StaticInlineAppConfig along your apps.

   .. code:: python

       INSTALLED_APPS = [
           # ...
           'staticinline.apps.StaticInlineAppConfig',
       ]

2. Load the template tag and pass a filename as you'd do with a ``static``
   template tag. You can also post-process the file content. In the example
   below we encode the content of the ``mykey.pem`` file with base64. Several
   encoders are already built-in, see the `Encoder docs`_.

   .. code:: django

       {% load staticinline %}

       <style type="text/css">{% staticinline "myfile.css" %}</style>
       My base64 encoded Key: {% staticinline "mykey.pem" encode="base64" cache=True %}


3. Enjoy the result:

   .. code:: html

       <style type="text/css">body{ color: red; }</style>
       My base64 encoded Key: LS0tIFN1cGVyIFByaXZhdGUgS2V5IC0tLQo=

.. _Encoder docs: https://docs.elephant.house/django-staticinline/encoder.html

=========
Changelog
=========

v1.3 (2018-08-15)
=================

- Added ``cache`` and ``cache_timeout`` templatetag arguments to store rendered
  values in cache.
- Added ``data_response`` AppConfig method to globally override the template
  tag response.

v1.2 (2018-08-14)
=================

- 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.


