当客户机通过 http 协议向服务器提交请求时,最常用到的方法是 GET 和 POST。 get - 从指定的资源请求数据。
post - 向指定的资源提交要被处理的数据
本次使用django设计登录界面
- index.html:登录起始页
- manage.html:登录成功后的跳转页
- login_action.html:处理登录请求,失败后返回该界面
> index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>用户登录</title>
</head>
<body>
<h2>发布会管理</h2>
<form method="post" action="/login_action/">
<input name="user" type="text" placeholder="user"><br>
<input name="psd" type="psd" placeholder="psd"><br>
{
{ error }} <br>
<button id="btn" type="submit">登录</button>
{% csrf_token %}
</form>
</body>
</html>