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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_css_inline-0.0.4.tar.gz.
File metadata
- Download URL: django_css_inline-0.0.4.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0883419278957c570c70704ab4d9e80a8b523ba2997ac347eb97ecc85cc12bfc
|
|
| MD5 |
0309eb64e15b41009d4c2267a087cf6b
|
|
| BLAKE2b-256 |
342b50bac1b8307768675b9d2a012179a35f75cc20edfd4f46a54469b58e9941
|
File details
Details for the file django_css_inline-0.0.4-py3-none-any.whl.
File metadata
- Download URL: django_css_inline-0.0.4-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da450510f99463ec6941e64ecced33cf2ecca5bb52b4b599321cbd72244e1c26
|
|
| MD5 |
196786233d784d1caf6f759130227f6b
|
|
| BLAKE2b-256 |
b3195ecb3b9dc68bcd0553ac47b4eaa3cce7ac9524aef3333722ed45aeda4a5e
|