Django CSS Inline
Project description
Simple helper for loading CSS files as inline in HTML with Django.
Example :
{% load css_inline %} ... <head> ... {% css_inline %} <link rel="stylesheet" href="/static/django_css_inline/test-1.css"> <link rel="stylesheet" href="/static/django_css_inline/test-2.css"> <link rel="stylesheet" href="https://static.snoweb.fr/django-css-inline/test-3.css"> {% end_css_inline %} </head>
Every <link> includes between {% css_inline %} and {% end_css_inline %} give this results :
<head> ... <style type="text/css"> /* test-1.css styles */ /* test-2.css styles */ /* test-3.css styles */ </style> </head>
Setup
Install with pip :
pip install django-css-inline
Add django_css_inline to django apps installed :
INSTALLED_APPS = [ ... 'django_css_inline', ]
In settings.py, chose to enable or disable django_css_inline. For example :
# Default True DJANGO_CSS_INLINE_ENABLE = not DEBUG
If you use static files with Django, don’t forget to collect them with :
python manage.py collectstatic
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_css_inline-0.0.6.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for django_css_inline-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 076df4ce8ced59fbfff7cc62610c1621a4effa48340b4600269e2d884bc6deed |
|
MD5 | db1bf4d87f1f6db9cfbec943ed958326 |
|
BLAKE2b-256 | 18f02aff09088ced07fc10d06a8dafc953e547da04b97f291f84e60c6341b5fe |