Skip to content

Cruel/django-mjml-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages