I am using django rest framework filters in my app. For a viewset that
looks like following:
|classProductViewSet(viewsets.ModelViewSet):queryset
=Product.objects.all()serializer_class =ProductSerializerlookup_field
='slug'filter_backends =(SearchFilter,DjangoFilterBackend,)filter_fields
=('category__slug','brand__slug')|
It adds following url:
|http://*.compute.amazonaws.com:8000/product/?category__slug=smart-phone&brand__slug=asus&|
I want to keep using|DjangoFilterBackend|as I am using, but I want the
api to look like following:
|http://*.compute.amazonaws.com:8000/categories/smart-phone/brands/asus|
I know that I can use RedirectViews but I don't want to redirect user.
Can I somehow make alias urls without using nginx or other reverse proxy
tools?
Sadaf Noor (@sadaf2605 <http://twitter.com/sadaf2605>)
http://blog.sadafnoor.com
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b477ba0d-e6fc-078e-2f48-863195578a93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.