We've just started the complete redesign of our project's HTML pages (responsive layout and stuff) and all we need to change is templates and static (css and some js). Views ain't gonna change at all. I want to create all the new templates in another folder next to existing old one, e.g. "new templates", so when the work is complete we can just change our TEMPLATE_DIRS setting and that's it.
But obviously we want to let our users (for the first couple of weeks after deploying it) choose if they want to try the new version or stay with the old one. Ok, that's simple - I ask a user and put his answer into his session:
request.session['new_design'] = True
And now in some custom middleware it would be nice to write something like this:
if request.session.get('new_design', False):
settings['TEMPLATE_DIRS'] = (MY_NEW_TEMPLATE_DIR, ) + settings['TEMPLATE_DIRS']
So when it comes to template loading in whatever view, my brand new templates folder will be searched first. But I know I just can't modify settings on the fly!
Is there any other way to archive same results? I thought about subclassing filesystem.Loader... But how can I make it aware of current request/session contents? Any other suggestions?
UPD: I forgot to mention: subdomains are already used for city selection e.g. la.domain.tld would represent only objects available for LA users. So adding a fourth subdomain isn't that great.
ps And once again just to make it clear: the main goal is not to touch any view!