post接参

前端:
<form method="post" action="./userRegister">
{% csrf_token %}
<input type="text" name="email" class="form-control" placeholder="用户名"><br>
<input type="password" name="pwd" class="form-control" placeholder="密码"><br>
<input type="text" name="nicheng" class="form-control" placeholder="昵称"><br>
<input type="submit" value="注册" class="btn btn-primary"/>
</form>

后端:
from django.shortcuts import render
from django.http import HttpResponse


def zhuce(request):
if request.method == 'POST':
email = request.POST['email']
return HttpResponse(email)
#return render(request,'novel.html');

posted @ 2017-11-06 21:05  时间影像  阅读(122)  评论(0编辑  收藏  举报