Skip to content

Instantly share code, notes, and snippets.



Created Oct 1, 2020
What would you like to do?
class SampleView(APIView):
def get(self, request):
user_agent = request.user_agent
browser =
browser_version = user_agent.browser.version_string
os =
os_version = user_agent.os.version_string
is_pc = user_agent.is_pc
is_mobile = user_agent.is_mobile
return Response('success')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment