Django “get() got an unexpected keyword argument 'pk'” error

后端 未结 3 728
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 19:08

I am trying to redirect to a page I intend to implement as an object\'s homepage after creation of one.

Below is corresponding part of my views.py

           


        
3条回答
  •  暖寄归人
    2020-12-30 19:54

    add the kwargs into the method definition:

    def get(self, request, *args, **kwargs):
        return HttpResponse("Created :)")
    

提交回复
热议问题