这里使用的是django1.5
需求: 有一个界面A,其中有一个form B, 前台提交B之后,后台保存数据之后,返回界面A,如果保存失败需要在A界面提示错误。
这里就需要后台的重定向,而且需要可以带着参数,也就是error message
这里收集了几种方法,简答说下需要那些包,怎么简单使用。
一、 使用HttpResponseRedirect
The first argument to the constructor is required – the path to redirect to
前言
本文使用了Django1.8.2
使用场景,例如在表单一中提交数据后,需要返回到另一个指定的页面即可使用重定向方法
一、 使用HttpResponseRedirect
fuhao The first argument to the constructor is required – the path to redirect to. This can be a fully qualified URL or an absolute path with no domain。”参数可以是绝
django-definicoes
Django:Guia dedefiniçõespara重定向,reverse,reverse_lazy,HttpResponse输入结果
Este projeto foi feito com:
Como rodar o projeto?
克隆esserepositório。
使用Python创建虚拟环境3。
虚拟环境。
作为依赖的过时。
像偏头痛一样骑。
git clone https://github.com/rg3915/django-