We have Python middle-tier for our Web App . Now we need to render 3 different HTMLs...
- for older browsers (simple read-only interface)
- for HTML5 browsers (LOT more complex than older browsers)
- for mobile website (simple XHTML-MP)
Now, we need to keep the Python middle-tier completely independent of any HTML -- just pure business logic.
So, we think we should use a PHP layer on top of Python to generate these HTMLs. PHP would talk to Python via SOA.
First -- is this a good idea? And if not, can you suggest a better design?
Second, if this is a feasible design -- do you think PHP+Python is good (maintainable) mix. If not, how about replacing the PHP layer by yet another Python layer.
Just remember that our middle-tier needs to be COMPLETELY isolated from any HTML thingy :)
-- UPDATE --
The reason we're inclined to using PHP is...
- PHP itself is just a template engine embedded into HTML -- and it is SO easy to generate complex HTML with it. On the other hand, Python is more of a general purpose language and generating HTML with it will require us to use a third party library which will entail maintenance/upgrade/security hassles. Generating HTML is a sort of raison d'ĂȘtre for PHP.
- Secondly, Python support for Nginx is NOT as good as PHP.