时间:2021-07-01 10:21:17 帮助过:20人阅读
Templates--->user_info.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
margin:0;
}
.menu{
display: block;
padding: 5px;
}
</style>
</head>
<body>
<div style="height: 48px;background-color: black;color: white;">
</div>
<div>
<div style="position: absolute;top:48px;bottom: 0;left: 0;width: 500px;background-color: brown">
<a class="menu" href="/cmdb/user_info/">用户管理</a>
<a class="menu" href="/cmdb/user_group/">用户组管理</a>
</div>
<div style="position: absolute;top:48px;left: 520px;bottom: 0;right: 0;overflow: auto">
<h3>添加用户</h3>
<form method="POST" action="/cmdb/user_info/">
<input type="text" name="user">
<input type="text" name="pwd">
<input type="submit" value="添加">
</form>
<h3>用户列表</h3>
<ul>
{% for row in User_List %}
<li><a href="/cmdb/userdetail-{{ row.id }}/">{{ row.username }}</a> |
<a href="/cmdb/userdel-{{ row.id }}/">删除</a> |
<a href="/cmdb/useredit-{{ row.id }}/">编辑</a> |
</li>
{% endfor %}
</ul>
<ul>
</ul>
</div>
</div>
</body>
</html>
Templates--->user_edit.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
margin:0;
}
.menu{
display: block;
padding: 5px;
}
</style>
</head>
<body>
<div style="height: 48px;background-color: black;color: white;">
</div>
<div>
<div style="position: absolute;top:48px;bottom: 0;left: 0;width: 500px;background-color: brown">
<a class="menu" href="/cmdb/user_info/">用户管理</a>
<a class="menu" href="/cmdb/user_group/">用户组管理</a>
{# <a class="menu"></a>#}
</div>
<div style="position: absolute;top:48px;left:520px;bottom: 0;right: 0;overflow: auto">
<h1>编辑用户</h1>
<form method="post" action="/cmdb/useredit-{{ OBJ.id }}/">
<input style="display: none" type="text" name="id" value="{{ OBJ.id }}"/>
<input type="text" name="username" value="{{ OBJ.username }}"/>
<input type="text" name="password" value="{{ OBJ.password }}"/>
<input type="submit" value="提交">
</form>
</div>
</div>
</body>
</html>
Templates--->user_detail.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
margin:0;
}
.menu{
display: block;
padding: 5px;
}
</style>
</head>
<body>
<div style="height: 48px;background-color: black;color: white;">
</div>
<div>
<div style="position: absolute;top:48px;bottom: 0;left: 0;width: 500px;background-color: brown">
<a class="menu" href="/cmdb/user_info/">用户管理</a>
<a class="menu" href="/cmdb/user_group/">用户组管理</a>
</div>
<div style="position: absolute;top:48px;left: 520px;bottom: 0;right: 0;overflow: auto">
<h1>用户详细信息</h1>
<h5>id: {{ OBJ.id }}</h5>
<h5>username: {{ OBJ.username }}</h5>
<h5>password: {{ OBJ.password }}</h5>
</div>
</div>
</body>
Django实例(3)-用户连数据库登入系统
标签:view lse red mit def inpu nbsp length first