Skip to main content

Django CSS Inline

Project description

https://img.shields.io/pypi/v/django_css_inline https://img.shields.io/pypi/pyversions/django_css_inline

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 = 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.2.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

django_css_inline-0.0.2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file django_css_inline-0.0.2.tar.gz.

File metadata

  • Download URL: django_css_inline-0.0.2.tar.gz
  • Upload date:
  • Size: 15.8 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

Hashes for django_css_inline-0.0.2.tar.gz
Algorithm Hash digest
SHA256 79250253c031615d2ffa3efd9a3aaa165fa2fbacae26bd8a0cc9ed9ce1d1baa5
MD5 e4b65c17a0aeba3cba783f19c52836b3
BLAKE2b-256 adda39f8541e2ed1ab375c6b0f612015352131851ddbaecd23c48439810f3c34

See more details on using hashes here.

Provenance

File details

Details for the file django_css_inline-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: django_css_inline-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.0 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

Hashes for django_css_inline-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ae1daa2e126bc4acd32b81233eb8ffbb9b7240f81bcad3904fbbaead12bbcc6
MD5 94375735b018a2dc2838069d08d669dd
BLAKE2b-256 fe82ec3959c578cd54618f92566956c1142078a319ece93e81c1e701bb070bea

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