Wednesday, April 8, 2015

`base_name` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.model` or `.queryset` attribute.

Try doing this in your urls.py. The third parameter 'Person' can be anything you want.

router.register(r'person/food', views.PersonViewSet, base_name='Person');

Reference:

http://stackoverflow.com/questions/22083090/what-base-name-parameter-do-i-need-in-my-route-to-make-this-django-api-work
http://www.django-rest-framework.org/api-guide/routers/

No comments:

Post a Comment