In my welcome app's db.py file, this is what I use to switch to the mobile 
view:

if request.is_mobile and request.extension == 'html':
    mobile_view = os.path.join(
        request.controller, request.function + '.mobile.html'
    )
    
    if os.path.exists(os.path.join(request.folder, 'views', mobile_view)):
        response.view = mobile_view

So really, to use a different name for the mobile files, you would just 
change the one line in the db.py. I didn't really know where to put this in 
web2py's code, so I just put it in db.py for now. Do you think there is a 
better way to do this?

Reply via email to