I am using UpdateModelMixin from Django rest framework to update the entries from the Test model.
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
from rest_framework import mixins, filters, viewsets
decorators = [never_cache]
@method_decorator(decorators, name='dispatch')
class TestViewSet(mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
viewsets.GenericViewSet):
queryset = Test.objects.all()
serializer_class = TestSerializer
filter_backends = [filters.DjangoFilterBackend]
filter_class = TestFilter
When I try to update the object from the Test Model It's giving following error -
"detail": "CSRF Failed: CSRF token missing or incorrect."
Can anyone please help me to resolve this issue?