Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Birdsong without Nodejs dependency #27

Open
OBKF opened this issue Nov 15, 2022 · 5 comments
Open

Birdsong without Nodejs dependency #27

OBKF opened this issue Nov 15, 2022 · 5 comments

Comments

@OBKF
Copy link

OBKF commented Nov 15, 2022

I really love this plugin, It worked well on my development machine, but when I deployed it on my cpanel shared hosting it failed because their Python apps don't have access to Nodejs.

Is it possible to use some other implementation of mjml like this pure python one? Or maybe use a binary executable of the mjml package (I don't know it exists, I can't find one) instead of using Nodejs.

Thanks.

@seb-b
Copy link
Member

seb-b commented Nov 17, 2022

Have you looked into running an MJML http server? You could set it up on a different server (on something like aws lambda or fly.io) and call out to it from your wagtail server

There's a bit about it in the django-mjml readme - https://github.com/liminspace/django-mjml#httpserver-mode

Adding a pure python mjml backend might be better addressed in django-mjml, looks like there's an issue about custom backends in that repo - liminspace/django-mjml#122

@OBKF
Copy link
Author

OBKF commented Nov 17, 2022

@seb-b Thanks, for now, I am implementing a simple newsletter using Django forms and stuff, while researching the links you provided.

It would be nice to have a system where you design your email in an external software, like Figma or MJML designer and upload the email files as zip and use that.

@raph146
Copy link
Contributor

raph146 commented Dec 5, 2022

Or maybe use a binary executable of the mjml package (I don't know it exists, I can't find one) instead of using Nodejs.

When looking for ways to avoid the use of Node in production environment, I found out you can use pkg to generate a binary of a given package.
Then you just have to update the command path in the settings, and add the generated file to your repository so that it's available on your server too.
Details here : mjmlio/mjml#2450 (comment)

However, I personally think it's best to run your own http server, as @seb-b suggested.

@david-smejkal
Copy link
Contributor

Example of how to use your own mjml http server can also be found in Birdsong's own tests:

@yhay81
Copy link

yhay81 commented Mar 10, 2024

Birdsong uses django-mjml and django-mjml has a GitHub Issue in that they discuss about using mjml-python which has no Nodejs dependency.
liminspace/django-mjml#184

Thus, one option is contribute that issue or just wait until it is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants