11
Google App Engine python을 사용하고 있습니다. 사용자가 어떤 브라우저를 사용하고 있는지 알고 싶습니다. 당신이 장고를 사용하는 경우Google App Engine python의 User-Agent
Google App Engine python을 사용하고 있습니다. 사용자가 어떤 브라우저를 사용하고 있는지 알고 싶습니다. 당신이 장고를 사용하는 경우Google App Engine python의 User-Agent
class BaseRequestHandler(webapp.RequestHandler):
def browser(self):
return str(self.request.headers['User-Agent'])
, 그것은해야한다 :
def some_view(request)
return HttpResponse(request.META['HTTP_USER_AGENT'])
경우 webapp2 :'self.request.headers.get ('사용자 에이전트') ' –