Is there a web framework/toolset that can handle (consistently) the whole spectrum from static content to full applications?
I've inherited a website that's all over the place -- much of it is straight HTML, but there are also a lot of PHP pages of varying complexity, ranging from little bits of inline code to full-blown applications, as well as CGI (mostly Perl), some Java apps (via mod_jk), and a smattering of other technologies.
Each of these pieces was arguably a good choice for its particular need -- no point in invoking a full framework for straight static content, for example -- but this fragmentation is visible from the outside as inconsistency in look and behavior, leading to an unpolished and unprofessional user experience, so I'd like to start bringing things into a common framework.
My experience is coming more from the back end, so the systems I know (Django, Rails, SpringMVC, etc) are predicated on the idea that the app is running things and individual pages are just for surfacing its data. And while they "support" static content, they don't do it particularly well IMO. That really won't work here -- there is a lot
of static/mostly static content, and it can't be treated as an afterthought.
Meanwhile, while I've never really liked PHP, in part because I haven't seen it work well for full-blown apps, its model of code injected into a page does work well for static content that might have just a couple bits of dynamic data in it.
So what I'm looking for is something that can work well at both ends of the spectrum as well as points in between, eg:
* Totally static page (but headers/footers/nav should be data-driven)
* Static page with a couple bits of dynamic content
* Dynamic content with full app functionality (eg. sessions, etc) but still driven by the page
* Typical MVC stack
My go-to for web development is Django, so my current approach basically a version of the staticfiles app that maps to any .html file in the public document path and processes it as a template, so "static" files can invoke Django template tags, but this runs into the reasons the staticfiles app is discouraged for production deployments. I like the idea of Hyde
, allowing static-but-data-driven pages to be produced by an app but served by something like Apache, but I'd need something like this to work "on demand" rather than replacing the application server.
The other option I see is to accept that PHP does its thing well and stick with that for the simple cases, and basically try to build the common libraries into more of a framework.
Any thoughts / suggestions?