Index ¦ Archives  ¦ Atom  ¦ RSS

Django (Simple) Template Maker

I was recently building an app that takes an email template and sends it to a membership list, and thought that I should be able to allow the users to make the templates themselves. The templates that I had seen for the past 4 years for the emails have been supremely simple, just a name here and there in different, already-made formats. So I built a quick TinyMCE 'plugin' and accompanying jQuery code that takes some JSON object as a context variable, and allows an HTML template to be created with variables from the context.

In the actual template, it shows 'example' data in place of the variable, so if you clicked to insert {{site.title}} you'd actually see Fahhem's Blog but the HTML that gets sent to the server would say {{site.title}} in it.

I have it working, but part of another app so some time has to be spent to separate it into another app. Since this just provides a template, please recommend possible integration vectors. I can make it into a template tag, a form field, a form, etc, what do you recommend?

© Fahrzin Hemmati. Built using Pelican. Theme by Giulio Fidente on github.