How to pass a message from HttpResponseRedirect in Django?

后端 未结 4 1992
夕颜
夕颜 2020-12-25 11:57

I have a view which does the certain task and return to another view which render hello.html template.

def 1stview(request):
   #Do this
   #Do that
   retur         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-25 12:21

    from django.contrib import messages
    messages.success(request, _('Thank you'))
    return redirect('/whatever/')
    

提交回复
热议问题