what is reverse() in Django

前端 未结 7 1593
Happy的楠姐
Happy的楠姐 2020-11-30 16:40

When I read django code sometimes, I see in some templates reverse(). I am not quite sure what this is but it is used together with HttpResponseRedirect. How an

7条回答
  •  醉酒成梦
    2020-11-30 17:10

    The existing answers are quite clear. Just in case you do not know why it is called reverse: It takes an input of a url name and gives the actual url, which is reverse to having a url first and then give it a name.

提交回复
热议问题