Skip to main content

Simple and fast MJML rendering for Django templates.

Project description

CI pypi

Django MJML Template

Use MJML in your Django templates. A very small and fast implementation.

About

This package leverages MRML, a Rust implementation of MJML using bindings provided by mjml-python.

If you want to run MJML itself as a separate HTTP server endpoint for conversion, use django-mjml instead. It uses the same mjml template tag.

What is MJML?

From the documentation of the project:

MJML is a markup language designed to reduce the pain of coding a responsive email. Its semantic syntax makes it easy and straightforward and its rich standard components library speeds up your development time and lightens your email codebase. MJML’s open-source engine generates high quality responsive HTML compliant with best practices.

Requirements

  • Python >= 3.7
  • Django >= 1.11

Installation

To install the package, run the following command:

pip install django-mjml-template

Then update your settings.py:

INSTALLED_APPS = (
    ...
    'django_mjml_template',
)

Usage

Load mjml in your django template and use mjml tag that will compile MJML to HTML:

{% load mjml %}

{% mjml %}
  <mjml>
    <mj-body>
      <mj-section>
        <mj-column>
          <mj-text>Hello {{ user_name }}!</mj-text>
        </mj-column>
      </mj-section>
    </mj-body>
  </mjml>
{% endmjml %}

Contributions

Contributions, bug reports, and suggestions are welcome! Feel free to open an issue or submit a pull request.

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_mjml_template-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mjml_template-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file django_mjml_template-1.0.0.tar.gz.

File metadata

  • Download URL: django_mjml_template-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_mjml_template-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f9f69b2610419d8414989f5f53415e9802901821d1e08f6a41a277ff83180815
MD5 a62300330048c37d082043277bfffe31
BLAKE2b-256 fdb7086ad5ad3a1ee1bd1465b4b727a2f0a2c72d6e8990f052fff6c039e17d7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mjml_template-1.0.0.tar.gz:

Publisher: ci.yml on Cruel/django-mjml-template

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_mjml_template-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mjml_template-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bb50ea911dc5edcad14d8a82c5624591a664d9de44cc4b1815a2d43934830a5
MD5 15c215a1bf3bbfa0ca4573d8300bedbb
BLAKE2b-256 165fa80d832c6c8c239859313f30bb86e0184c0d31be4ccf4f7a6882f54e4730

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mjml_template-1.0.0-py3-none-any.whl:

Publisher: ci.yml on Cruel/django-mjml-template

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page