1.编写一个登录表单
第一步: 在sign/templates/index.html 文件中,开发一个简单的 登录表单
第二步:启动:Django服务,访问 : http://127.0.0.1:8002/index/
2. GET 请求:
第一步:给 form 表单添加属性 method="get" 方法
<body>
<h3>发布会签到系统</h3>
<form method="get">
<input name="username" type="text" placeholder="username"><br>
<input name="password" type="text" placeholder="password"><br>
<button id="btn" type="submit">登录</button>
</form>
</body>
第二步:保存 index.html 文件,刷新登录页面,输入用户名/密码:admin/admin123
查看结果:
3.post请求
第一步:在 from表单中将 属性 methtod="post‘ 改变成post
<body>
<h3>发布会签到系统</h3>
<form method="post">
<input name="username" type="text" placeholder