1👍
✅
After changing the URL in regex format, my issue was solved. Instead of this,
router.register('user/<int:user_id>/profile', ProfileViewSet, 'profile')
I wrote this,
router.register(r'user/(?P<user_id>\d+)/profile', ProfileViewSet, 'profile')
0👍
Change this line
router.register('user/<int:user_id>/profile', ProfileViewSet, 'intensity_classes')
Use this
router.register(r'users', ProfileViewSet, basename='user')
Then for list view
http://127.0.0.1:8000/users/ -> List of profiles
For detail view
http://127.0.0.1:8000/users/13
->here 13
is the profile id, you can update, delete the Profile instance
- [Answered ]-Django: How to 'scrub' list of users
- [Answered ]-Is there an sql admin panel made with Django? – Django
- [Answered ]-Django RawQuerySet.__repr__ : not enough arguments for format string
Source:stackexchange.com