Django template tag to load static files inline with your template.
Project description
django-staticinline
Similiar to Django’s native 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>
If the file does not exist, and DEBUG is False, an empty string is returned and a error logfile is set. In case DEBUG is True, a ValueError is raised.
Installation
This Django app is compatible with Django 1.8 → 2.0, Python 2.7 all versions of Python 3.x.
Install with pip and add staticinline to your installed apps in your settings.py:
pip install django-staticinline INSTALLED_APPS = [ # ... 'staticinline', ]
Changelog
v1.0 (2018-04-29)
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
Built Distribution
File details
Details for the file django-staticinline-1.0.2.tar.gz
.
File metadata
- Download URL: django-staticinline-1.0.2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb491c144ce5073d96f25e71a97780691ca7b1e046a468ca43a97d5298caf8a3 |
|
MD5 | c0e10725ebb4cec185c6dd8a839ea2f0 |
|
BLAKE2b-256 | dd9f5530d18bd5669c5e7632e00bd53c5218c1e8b135ef39b6634d824b89da68 |
File details
Details for the file django_staticinline-1.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_staticinline-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07bf275135b0a38a00b05e5270f853f3a797795265f441933206ccd8ce7196db |
|
MD5 | fc1319009c8846e39e494dee29d5f07e |
|
BLAKE2b-256 | 6045ea919b428a6659010e0f68523ddae0db20fcc85685740faa9a88cc44d4d5 |