Django 用户管理系统
效果
环境使用了bootstrap插件和一个js文件。
环境配置
js文件
下载链接:js,进入网址,crtl+s 下载
然后移入static中的js文件中。
bootstrap插件
下载链接:bootstrap
解压,然后移入static下plugins文件中。
前端搭建
引入基本架构
{% load static %}
<html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1-dist/css/bootstrap.css' %}">
<style>
.navbar{
border-radius: 0;
}
</style>
</head>
<body>
<script src="{% static 'js/jquery-3.6.0.min.js' %}"></script>
<script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap.js'%}"></script>
</body>
</html>
访问官网 引入模板 删改
官网地址:bootstrap
删除不需要的输入框,多余的导航条等。
引入面板 修改
选中想要的图标,复制html文件
最终删改后的效果
代码:
<div>
<div class="container">
<div style="margin-bottom: 10px">
<a class="btn btn-success" href="#">
<span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
新建部门
</a>
</div>
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
部门列表
</div>
<!-- Table -->
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>销售部</td>
<td>
<a class="btn btn-primary btn-xs">编辑</a>
<a class="btn btn-danger btn-xs">删除</a>
</td>
</tbody>
</table>
</div>
</div>
</div>