Identifying the browser in python pylons

9 views
Skip to first unread message

gary clark

unread,
Aug 2, 2010, 7:20:43 PM8/2/10
to pylons-...@googlegroups.com
Hey Guys,

Is there a way to identify the browser? Essentially my site looks good on standard desktop, but when
I look at on my smart phone and images are getting crunched hence I want to present a simple interface if the browser used
is a webkit browser for instance.

Much appreciated,
Gazza

gary clark

unread,
Aug 2, 2010, 7:27:38 PM8/2/10
to pylons-...@googlegroups.com
request.environ["HTTP_USER_AGENT"]

David King

unread,
Aug 3, 2010, 4:34:50 PM8/3/10
to pylons-...@googlegroups.com
> request.environ["HTTP_USER_AGENT"]

And just to elaborate on this, note that this is specific to HTTP, not Pylons. Also note that as an HTTP header passed by the user, users can (and many do) fake their user-agent, often to appear to be things like Google's crawler, versions of IE that they are not using (because of old brain-dead servers that deny anything that isn't IE), etc. Try googling around for "http user agent" to see some common issues associated with relying on this header.

Also since you're targetting smart phones, see if you can get some advice from other smartphone developers on how they deal with this. For instance, personally I *hate* being forced into a smartphone-only site when that site is not 100% as featured as the site I wanted to go to.

gary clark

unread,
Aug 3, 2010, 4:53:57 PM8/3/10
to pylons-...@googlegroups.com
will do. I am going to start working on android soon to hook into my pylons server. Appreciate the information.

Gazza


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.


Reply all
Reply to author
Forward
0 new messages