web.ctx.env['HTTP_USER_AGENT']

define a hook function for every request?
or use decorator for every processor

2011/8/31 Paolo <[email protected]>

> Hello!
>
> I'm trying to develop a mobile version of my web site.
> I think that for the moment it could be quite enough to just have a
> specific CSS that is used whenever a User-Agent of a mobile device is
> detected in the HTTP headers.
>
> In order to do so, I would need to inspect each and every HTTP request
> and look for a mobile user agent (maybe using a regexp as shown at
> detectmobilebrowsers.com) and then, if detected, passing a flag to the
> template render function to make it include the CSS.
>
> So my question is: is there a way, a function, a point in the web.py
> code where I can put my function that checks for the presence of the
> User-Agent at each request indipendently from the URI requested..?
>
> (And my second question would be: am I doing anything really dumb..?
> In other words: is there a much simpler way to do so..?;)
>
> Thanks in advance.
>
> paolo
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to