Thanks for helping me out .

On Thursday, April 16, 2020 at 2:34:13 PM UTC+5:30, Kasper Laudrup wrote:
>
> Hi Shreehari 
>
> On 16/04/2020 10.17, shreehari Vaasistha L wrote: 
> > Object of type ValueError is not JSON serializable 
> > 
> > 
> > getting this above error 
> > 
>
> First of all, don't highjack other unrelated threads. Create your own 
> with a descriptive subject. 
>
> You get the error because of the lines: 
>
> except Exception as e: 
>             return Response(e) 
>
> You cannot serialize the exception object, but your real problem is most 
> likely the actual exception being thrown. 
>
> Try to remove the entire try/except block. You most likely don't want to 
> return errors in your code to the user anyway so returning an HTTP 500 
> to the user and letting Django write the exception message and 
> stacktrace in your log is probably much better. 
>
> Kind regards, 
>
> Kasper Laudrup 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/87eade6b-38e0-4b61-9d3f-0d6f08b2ed85%40googlegroups.com.

Reply via email to