How do I make it so that this form is cleared after a POST request is sent? Right now, clicking POST refreshes the page and updates the table data but the form data remains.
The code I'm using is from the official Django REST Framework tutorial. Here is what the view for (listing and) creating views looks like:
class SnippetList(generics.ListCreateAPIView):
queryset = Snippet.objects.all()
serializer_class = SnippetSerializer
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
def perform_create(self, serializer):
serializer.save(owner=self.request.user)
