I’m new to django/tastypie. I’ve built an api and have get requests working fine but every time I run a post/put request I’m getting a 401.
This is my api:
class CategoryResource(ModelResource):
class Meta:
queryset = Category.objects.all()
resources_name = 'category'
Authorization=Authorization()
allowed_methods = ['get', 'post', 'put']
And this is my test:
def test_update_user_score(self):
response = self.c.put('/api/v1/category/', {'apikey': 1})
print response.status_code
any ideas greatly appreciated!
the 401 deals with Authorization problems.
I dont know if there is another problem with your code, but I can see a typo here:
must be:
with lowercase ‘a’.
Let us know if this solved your problem and assign points if helpful.
Best Wishes.