Re: Django rest framework error

2020-02-20 Thread MTS BOUR
Try from django.http import JsonResponse And use jsonresponse instead Le jeu. 20 févr. 2020 17:59, Soumen Khatua a écrit : > If I'm using serializer then it's working fine but I want to return only > database object. So for that Do I need to add serializer. > > Thank you for your response. > >

Re: Django rest framework error

2020-02-20 Thread onlinejudge95
On Thu, Feb 20, 2020 at 11:30 PM Soumen Khatua wrote: > If I'm using serializer then it's working fine but I want to return only > database object. So for that Do I need to add serializer. > You do have to serialize your responses, you just can't send Python objects as an HTTP response, think abo

Re: Django rest framework error

2020-02-20 Thread Soumen Khatua
If I'm using serializer then it's working fine but I want to return only database object. So for that Do I need to add serializer. Thank you for your response. On Thu 20 Feb, 2020, 11:17 PM MTS BOUR, wrote: > Can you show us your serializer.py file? > > > Le jeu. 20 févr. 2020 17:40, Soumen Kha

Re: Django rest framework error

2020-02-20 Thread MTS BOUR
Can you show us your serializer.py file? Le jeu. 20 févr. 2020 17:40, Soumen Khatua a écrit : > Hi Folks, > > I'm getting this error, I don't know how to solve it: > > > > > *File > "C:\Users\TildeHat\AppData\Local\Programs\Python\Python38-32\lib\json\encoder.py", > line 179, in defaultrais

Django rest framework error

2020-02-20 Thread Soumen Khatua
Hi Folks, I'm getting this error, I don't know how to solve it: *File "C:\Users\TildeHat\AppData\Local\Programs\Python\Python38-32\lib\json\encoder.py", line 179, in defaultraise TypeError(f'Object of type {o.__class__.__name__} 'TypeError: Object of type User is not JSON serializable* *

Re: Django rest framework - error 'TokenAuthentication' object has no attribute 'has_permission

2015-11-29 Thread Shekar Tippur
My bad. This was due to the permissions I had set on my class based view. I took out the tokenauthentication and it now works well. - Shekar -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Django rest framework - error 'TokenAuthentication' object has no attribute 'has_permission

2015-11-28 Thread Shekar Tippur
Hello, I am trying to use oauth2 provider as described in http://django-oauth-toolkit.readthedocs.org/en/latest/rest-framework/getting_started.html#step-1-minimal-setup 'TokenAuthentication' object has no attribute 'has_permission. Curl - curl -H "Authorization: Bearer $access_token" -H "Con