User-Agent in Google App Engine python

前端 未结 2 698

I\'m using Google App Engine python. I want to know what browser the user is using.

相关标签:
2条回答
  • 2021-01-02 02:48

    If you're using Django, that should be:

    def some_view(request)
        return HttpResponse(request.META['HTTP_USER_AGENT'])
    
    0 讨论(0)
  • 2021-01-02 03:03
    class BaseRequestHandler(webapp.RequestHandler):
      def browser(self):
        return str(self.request.headers['User-Agent'])
    
    0 讨论(0)
提交回复
热议问题