3👍
✅
A DRF ModelViewSet uses the queryset
to derive the URL base. If the queryset
property is not set, DRF asks that you use the optional base_name
property when registering the router to declare the base.
Check out this page in the DRF docs:
2👍
DRF Router is complaining, because it can’t automatically generate a basename for the viewset:
base_name – The base to use for the URL names that are created. If unset the basename will be automatically generated based on the queryset attribute of the viewset, if it has one. Note that if the viewset does not include a queryset attribute then you must set base_name when registering the viewset.
👤C14L
- [Django]-Django modelAdmin __init__ and inlines
- [Django]-Can't add object to Django's Many-To-Many Field
- [Django]-Django rest api validate data sent in the requests
Source:stackexchange.com