Skip to main content

Build Status

About

Inlining CSS is necessary for email generation and sending but is currently a surprisingly large hassle.

This library aims to make it a breeze in the Django template language.

Usage

Step 1: Dependencies

  • BeautifulSoup
  • cssutils
  • Python 2.7+,3.4+
  • Django 1.11+

Step 2: Install django_inlinecss

Add django_inlinecss to your settings.py:

INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.webdesign',
        'django.contrib.contenttypes',
        '...',
        '...',
        '...',
        'django_inlinecss')

Step 3: Use the templatetag

  1. Place your CSS file somewhere staticfiles can find it
  2. Create your template:
{% load inlinecss %}
{% inlinecss "css/extra-padding.css" %}
    <html>
        <body>
            <div class='lots-o-padding'>
                Something in need of styling.
            </div>
        </body>
    </html>
{% endinlinecss %}

Step 4: Prepare to be Wowed

<html>
    <body>
        <div style="padding-left: 10px; padding-right: 10px; padding-top: 10px;" class="lots-o-padding">
            Something in need of styling.
        </div>
    </body>
</html>

Acknowledgements

Thanks to Tanner Netterville for his efforts on Pynliner.

Thanks to Thomas Yip for his unit tests on the soupselect module. These tests helped on getting the core CSS2 selectors to work.

License

MIT license. See LICENSE.md for more detail.

Metadata

Release files for django-inlinecss 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-inlinecss 0.3.0
File Size Uploaded Provenance Actions
django-inlinecss-0.3.0.tar.gz 6.7 kB Without provenance Details for django-inlinecss-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-inlinecss 0.3.0
File Interpreter ABI Platform Actions
django_inlinecss-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_inlinecss-0.3.0-py2.py3-none-any.whl

Total release size: 15.6 kB

Release files / django-inlinecss-0.3.0.tar.gz

Download URL django-inlinecss-0.3.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5a014278b017a07d9d0babe2bf1bc75a52e184fb0ed26e333e8ff0d8e777b9e2
BLAKE2b-256 checksum
How to use checksums
c2d7fca167ea93f70185d6689df40aac136f0001d71d84ccc34151812c024b3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.10

Release files / django_inlinecss-0.3.0-py2.py3-none-any.whl

Download URL django_inlinecss-0.3.0-py2.py3-none-any.whl
Size 8.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
eddcb295a35fcddf4fce26f9c232c472a9283b954aaf084641d0718415bd694b
BLAKE2b-256 checksum
How to use checksums
c91c5d5e2c2bffff1e11cc7c7bf5d36cdf8e31d0c6ac36a528561ae815807238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.10

Security for django-inlinecss 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page