_reverse_with_prefix() argument after * must be an iterable, not int

后端 未结 2 2447
慢半拍i
慢半拍i 2021-02-20 18:32

I have used Django\'s reverse multiple times in the past but getting this error today which doesn\'t seem intuitive enough to debug:

TypeError: _rev         


        
2条回答
  •  星月不相逢
    2021-02-20 19:23

    You can also try to use kwargs={'pk':models_saving_variable.pk}.

    The final code will be:

    return HttpResponseRedirect(reverse('app_name:view_name', kwargs={'pk': saving_variable.pk}))
    

提交回复
热议问题