|
I've been looking to see how to create a mobile version of a project on Webfaction. Some prerequisites: 1. Using virtualenv 2. mod_wsgi 3. Want to use the same views and models, but different templates 4. Templates will be grabbed by changing the template_dirs setting in different settings files. For example: settings and settings_mobile So I thought I could do all this with VirtualHosts, but I keep getting stuck trying to get the wsgi files to see settings. It just keeps displaying the wsgi hello world message. Anyone see something I'm doing wrong in my .conf file? Please let me know what you think.
|
|
Hi Dave, There is nothing in your configuration that looks glaringly wrong, however, most of the Django mobile setups I have seen use a middleware that looks at the browser agent and grabs the templates or directs the browser to the right templates. but doesn't that mess up template inheritance? Meaning, you'd have to have a ton of complicated if checks to display template blocks based on the browser agent? So then everything would have to be in templates and you couldn't have a separate mobile directory? Or am I being over simplified? With this method I can have a mobile dir be the "templates" dir and then all templates could inherit from that dir, creating a completely isolated template branch. Yes, I do have to do some copy and pasting, but it's not too painful and helps keep things clean. Thoughts? Hi, I'm not quite sure how the middleware handles inheritance. From what I've seen of middlewares that do this is that they have an entirely different set of templates, that are simpler and don't have as much information in them. It looks like you've got a good solution, as well. For the solution to your settings problem, there is some good information here: http://forum.webfaction.com/viewtopic.php?id=3646 On running multiple django apps with different WSGI files from the same apache. |