Use MJML in Django templates
Project description
django-mjml
The simplest way to use MJML in Django templates.
Installation
Requirements:
Django v1.9+
mjml v2.0+
1. Install mjml.
See https://github.com/mjmlio/mjml#installation and https://mjml.io/documentation/#installation
2. Install django-mjml.
Via pip:
$ pip install django-mjml
Via setuptools:
$ easy_install django-mjml
For install development version use git+https://github.com/liminspace/django-mjml.git@develop instead django-mjml.
3. Set up settings.py in your django project.
INSTALLED_APPS = ( ..., 'mjml', )
Usage
Load mjml in your django template and use mjml tag that will compile mjml to html:
{% load mjml %} {% mjml %} <mjml> <mj-body> <mj-container> <mj-section> <mj-column> <mj-text>Hello world!</mj-text> </mj-column> </mj-section> </mj-container> </mj-body> </mjml> {% endmjml %}
Project details
Release history Release notifications | RSS feed
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-0.1.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for django_mjml-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c4b034a035510cfacc63e17b9d1bd36c3fa3c1c824cce827ba5d050338dd504 |
|
MD5 | 1e37a977c3912f5b3d48468d49298d8b |
|
BLAKE2b-256 | 29befbb50ae5b0e340ca8ab718723c55b836fc4e9a2ebc8935e87c631f50c9f8 |