--- id: django-premailer version: "0.2.0" license: MIT license_treatment: permissive maintenance: dormant --- # django-premailer — Django template tag that turns CSS blocks into style attributes using premailer. License: permissive · Maintenance: dormant · Downloads: 211.8K/mo ## What it is and what it does django-premailer is a Django template tag wrapper around the premailer library that converts CSS rules into inline style attributes on HTML elements. It is primarily designed for preparing HTML emails, where external stylesheets cannot be reliably loaded by mail clients. You load the tag in a template, wrap HTML content and CSS rules in the premailer block, and the tag outputs HTML with styles moved from the CSS block into inline style attributes on matching elements. The package has no runtime dependencies and installs cleanly. However, it has been dormant since 2016 with no active maintenance, meaning it may not be tested or compatible with modern Django versions or Python releases. The underlying premailer library is a separate dependency that you will need to install separately to use this tag. Use it for: - Preparing transactional email templates in Django where inline CSS is required for consistent rendering across email clients - Converting Django-templated HTML with CSS blocks into email-safe HTML for sending via SMTP - Building email notification systems that need styled HTML without relying on external stylesheet delivery - Inlining styles for HTML content that will be rendered in environments that strip external CSS links ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Django template tag that converts CSS blocks into inline style attributes on HTML elements, typically used to prepare HTML for email delivery where external stylesheets are not supported. Yes, if you are using an older Django version (1.6–1.9 range) and need inline CSS for email templates. No, if you are on a modern Django release—the package is unmaintained since 2016 and classifiers only list support through Django 1.9 and Python 3.5. Consider alternatives or verify compatibility with your Django version before committing to this package. ## Install pip install django-premailer uv add django-premailer poetry add django-premailer ## Installing django-premailer Before you install: Installation is straightforward with no runtime dependencies. The package is dormant—last release was in 2016 and last commit in 2024—so it receives no active maintenance, though the repository remains public and unarchived. License in practice: MIT license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install django-premailer # In settings.py, add to INSTALLED_APPS: INSTALLED_APPS = ( 'django_premailer', ) # In template: {% load premailer %} {% premailer "http://example.com" %} h1 { color: blue; } {{ content }} {% endpremailer %} Verify before relying: - Whether the underlying premailer library is actively maintained and compatible with current Django versions - Whether this package works reliably with modern Python versions beyond those listed in classifiers (3.5 and earlier) - Current test coverage and whether the package has been tested against recent Django releases ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 211.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django inline css, email html styling, css to style attributes, django template premailer, html email formatting, inline styles django, css inlining template tag, email-templating, django-extension [View on SkillFed](https://skillfed.io/packages/django-premailer) · [View on PyPI](https://pypi.org/project/django-premailer/)