Django Class Based Views, get_absolute_url not working

后端 未结 5 1408
闹比i
闹比i 2021-02-10 17:57

I bought and am Reading the Book Two Scoops of Django:Best Practices for Django 1.5 and in it has a example of Class based views. After this implementation I get the error afte

5条回答
  •  抹茶落季
    2021-02-10 18:09

    You can override your class-based view's get_success_url function. Like this:

    def get_success_url(self):
        return reverse("NonProfit", kwargs={"slug": self.object.slug})  
    

提交回复
热议问题