def get(self, request, format=None):
    template = get_template(template_name='myapp/template.html')
return Response({}, template_name=template.template.name)
How to use login_required in django rest view