Not sure if anyone has had experience with a good solution to rendering templates specifically for mobile devices using django.
I wrote a middleware request processor that uses regex to detect whether it is a mobile browser or not. I am currently setting a boolean attribute on the request so that I can use it further down the pipe. But really my business logic is the same I just want to use a different set of templates.
Is there a way for me to add a new template directory to settings.TEMPLATE_DIRS in the middleware processor, so that a mobile user would get the views I choose to rewrite, but everything else would fall back to the default template directories. But I need to make sure it doesn't persist between requests.
If i added a directory, would settings continue to hold onto it between requests?
..and if so, is this the right solution (checking the browser agent, adding an additional template folder, and then removing it at the end of each request)?