send error message from view to ajax

 

class DataInputInsightPage(View):

def post(self,request):
try:
// code
except Exception as ex:
return JsonResponse({'success': False, 'message': 'CSV file not found'}, status=404)
return JsonResponse(context)


Comments

Popular posts from this blog

Django Rest Framework Many To Many Relation with intermediate Table Serialization Example