Я использую Tastypie для API Django. но возвращает ошибку. мой код ниже.
$.ajax({
type : "POST",
url : "http://192.168.1.130:8000/api/user/author/",
data : '{"first_name": "111","second_name": "222"}',
success: function(){
alert('Submit Success')
},
dataType : 'json',
contentType : 'application/json',
processData: false
});
мой api.py вот так:
class AuthorResource(ModelResource):
class Meta:
queryset = Author.objects.all()
resource_name ='author'
fields = ['first_name','last_name']
filtering = {
'first_name': ALL,
}
authentication = Authentication()
authorization = Authorization()
он возвращает 200 и ничего не публикует. Как я могу его изменить?