Django - Messages functionality not working in Class based view
问题 Unable to display messages in class based view. In another app's views.py, it is working fine where I used function based view. views.py: class PostDeleteView(LoginRequiredMixin, UserPassesTestMixin, SuccessMessageMixin, DeleteView): model = Post success_url = '/user-profile/' success_message = "Your post has been deleted sucessfully!" def test_func(self): post = self.get_object() if self.request.user == post.author: return True return False urls.py: path('user-profile/', user_views.user