I want to use the class UpdateView from the Class-Based View , after I finish the update and submit the form I get the error HTTP 405 Method not allowed below the Update inherit class
class ArticleUpdateView(UpdateView):
template_name = "articles/article_create.html"
form_class = ArticleModelForm
queryset = Article.objects.all()
success_url = "/"
def get_object(self):
id_ = self.kwargs.get("id")
return get_object_or_404(Article , id=id_)
def form_valid(self,form):
print(form.cleaned_data)
return super().form_valid(form)