Django Class Based Views, get_absolute_url not working

后端 未结 5 1369
闹比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:28

    Try to remove the @permalink decorator from your get_absolute_url method. It cannot work together with reverse.

    Also, the Django documentation states the following:

    The permalink decorator is no longer recommended. You should use reverse() in the body of your get_absolute_url method instead.

提交回复
热议问题