Mango – Mobile Django – Templates

I am a strong believer in a future where mobile devices would actually be servers too.  This is not a new idea or anything.  And Il admit I jumped on the bandwagon quite late.  Though jumping is not what I did out of trying to follow the popular opinion.  It all started when I got the iPhone and it hit me like a truck.  So it wasnt a bandwagon jumping moment as it was a getting-hit-by-a-truck moment.

Anyway, clearly servers on mobile devices instead of server boxes sitting in some rack is exciting.  Imaging you are on the move with a few people on a train and voila you have a webserver you can put up for sharing.  Mind you, this is not that different or even superior to P2P (locally via Bluetooth or globally).  Just another alternative.  So one of the tools I figured Il use quite a bit on my mobile, should it take off as a webserver is a templating engine.  Here is where Mango comes in.  This was actually inspired by Django templates.  And being a big worshipper of Django, I think of Django as a philosophy and not just as a framework.  So first thing was the port of the templating engine.

Where exactly am I porting it to?  First of all the code is opened under an Apache license and is on git.  Secondly I am porting it to android and objective C.  The objective C version is woefully behind, where as the android version has support for a lot of stuff (for, if, include, variables etc) and has a full set of unit tests with it.  Frankly I find android a much much more intuitive platform to develop than XCode (and objective C).  May be it has to do with my familiarity with java.  The objective C version will follow shortly.

So why another templating engine – Well I had envisaged 2 use cases for it:

1. Consume json or xml data from a backend and apply a template on the data from the client (mobile).

2. Mobile generates the content and applies a template to it before sending off the response to a client’s request.

Either way a separate templating engine helps.

Please feel free to try it out. Would appreciate any and all feedback and not to mention help with extending it to a large number of tags and filters.

1. Check it out from git at

2. Start eclipse (must have java and android)

3. Open the mango and the mangotest projects (from mango/android and mango/android/test respectively).

4. Select the mangotest project and Run As Junit – watch the unit tests.


3 thoughts on “Mango – Mobile Django – Templates

    • Id say serving any content (files to start off with) within a private network without having to go through the cloud would be one thing. Effectively real P2P and real distributed content.

      Do you remember when Opera put in a webserver on their brower, why do you think they were trying to do that? I think the same rationale applies here. And in fact Id say that idea actually is actually more applicable to mobiles than it is to a desktop…

      Whatd you reckon?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s