Django Inlinecss Save

A Django app useful for inlining CSS (primarily for e-mails)

Project README

Build Status


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.


Step 1: Dependencies

  • BeautifulSoup
  • cssutils
  • Python 3.8+
  • Django 3.2+

Step 2: Install django_inlinecss

Add django_inlinecss to your


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" %}
            <div class='lots-o-padding'>
                Something in need of styling.
{% endinlinecss %}

Step 4: Prepare to be Wowed

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


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.


MIT license. See for more detail.

Open Source Agenda is not affiliated with "Django Inlinecss" Project. README Source: roverdotcom/django-inlinecss
Open Issues
Last Commit
1 month ago

Open Source Agenda Badge

Open Source Agenda Rating