User authentication fail for POST method in TastyPie

时间:2017-06-14 10:27:05

标签: python django rest tastypie

I am using Tastypie (django-tastypie-0.9.11) with Django 1.4.For authentication I am using TastyPie's BasicAuthentication. Passing Authorization token in headers as

headers = {'Authorization': 'Basic xyzwlhkhkg'}

So, while debugging the code I noticed, the same header create a user object only when the request method if 'get' but user object is not getting created in case of post method. My problem is why it's not getting authenticated in case of the post. I tried using csrf_exempt still it doesn't solve the problem.

Can anyone please help.

0 个答案:

没有答案