Skip to content

Instantly share code, notes, and snippets.

@Allwin12

Allwin12/views.py

Created Oct 1, 2020
Embed
What would you like to do?
class SampleView(APIView):
def get(self, request):
user_agent = request.user_agent
browser = user_agent.browser.family
browser_version = user_agent.browser.version_string
os = user_agent.os.family
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
You can’t perform that action at this time.