部分代码:
<!DOCTYPE html>
{% load staticfiles %}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<link href="{% static 'css/denglu.css' %}" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="stylesheet" href="{% static 'css/zhuce1.css' %}">
</head>
<body>
<!-----头部------>
<div style="width: 1200px;margin:40px auto 0 auto;height: 80px;overflow: hidden">
<div style="width:150px;float: left;height: 60px;"><a href=""><img src="{% static 'img/logo.jpg' %}" width="350" height="80"></a></div>
<div style="float:left;margin-left:200px;">
<ul style="float:left;">
<li style="padding-top: 10px;padding-left: 20px;float: left;color:#C0BEBE;"><h1>|</h1></li>
<li style=" padding-top: 10px;padding-left: 20px;float: left;color:#C0BEBE"><h2 style="padding-top:7px;">用户登录</h2></li>
</ul>
</div>
</div>
<!---------中部内容---------->
<div style="height: 560px;
background-image:url({% static 'img/14.jpg' %});
background-size: cover;" >
<div class="denglu">
<h4>密码登录</h4>
<div class="content-box">
<form action="" method="post">
<div class="zhanghao">
<img src="{% static 'img/登录1.png'%}" width="39"><input type="text" size="35" class="zh" id="zh" name="username" maxlength="12" style="width:250px" value placeholder="用户名" required>
</div>
<div class="mima">
<img src="{% static 'img/登录2.png' %}" width="39"><input type="password" size="35" class="mm" name="password" maxlength="12" style="width:250px" value placeholder="密码" required>
</div>
<div>
<span style="color: green">{{error}}</span>
</div>
<div class="submit">
<input type="submit" class="submit1" id="submit" value="登录">
</div>
</form>
</div>
<div class="content-bottom-di">
<ul>
<li><a href="{% url 'reg' %}">用户注册</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
效果图: