--- id: django-mjml version: "1.5" license: MIT license_treatment: permissive maintenance: active --- # django-mjml — Use MJML in Django templates License: permissive · Maintenance: active · Downloads: 101.3K/mo ## What it is and what it does django-mjml is a Django app that lets you write responsive email templates using MJML (Mailjet Markup Language) directly in your Django templates. Instead of hand-coding complex HTML email layouts, you write simpler MJML markup and the package compiles it to production-ready HTML at render time. It acts as a bridge between Django's template system and the MJML compiler, handling the compilation process transparently. The package supports three rendering backends: a simple command-line mode (default, slower), a faster TCP-server mode for high-volume rendering, and an HTTP-server mode that can use the official MJML API or your own HTTP server. You configure which backend to use in Django settings, and the template tag remains the same. It requires Django 2.2 to 6.0 and Python 3.9+, with no other mandatory runtime dependencies beyond django itself. Use it for: - Render responsive email templates in Django views without writing raw HTML table layouts. - Build reusable MJML email components as Django template includes for consistent branding across transactional emails. - Scale email rendering by switching from cmd mode to tcpserver or httpserver mode as volume grows. - Integrate MJML templates into Django's email backend for automated password-reset and notification emails. - Validate email HTML output during development by leveraging MJML's built-in validation and minification options. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Django template tag that compiles MJML (Mailjet Markup Language) to HTML, supporting multiple rendering backends including command-line, TCP server, and HTTP API modes. Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real problem—writing responsive emails is tedious without a markup language designed for it. Use it if you need to generate HTML emails in Django and want to avoid hand-coding complex table layouts. The multiple rendering backends let you start simple and scale later. ## Install pip install django-mjml uv add django-mjml poetry add django-mjml ## Installing django-mjml Before you install: Low friction installation with a single runtime dependency (django). Actively maintained with recent releases; last commit 2026-08-14. Requires external mjml installation and optionally requests library for HTTP-server mode. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice. Quickstart: pip install django-mjml # In settings.py: INSTALLED_APPS = (..., 'mjml') # In template: {% load mjml %} {% mjml %} Hello world! {% endmjml %} Requires mjml (version 4.14.1 to 4.17.2) to be installed separately on the system; see https://github.com/mjmlio/mjml#installation. Optionally requires requests (2.24.0+) for HTTP-server rendering mode. Verify before relying: - Whether the package's three backend modes (cmd, tcpserver, httpserver) have measurable performance differences in production workloads. - Whether MJML_CHECK_CMD_ON_STARTUP=False actually provides meaningful startup speedup in typical deployments. - Compatibility testing status with Django 6.0 (listed as supported but package last released 2025-12-07). ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 101.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django mjml template tag, mjml email templates django, responsive email markup django, mjml html compiler django, email template rendering django, mjml to html django, mailjet markup language django, email-templates, mjml, django-app [View on SkillFed](https://skillfed.io/packages/django-mjml) · [View on PyPI](https://pypi.org/project/django-mjml/)