login
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div style="margin: 0 auto; 500px"> <h1>管理员登录</h1> <form class="form-horizontal" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">账号</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="账号" name="username" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">密码</label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword3" placeholder="Password" name="password" required> </div> </div> <span style="color: red">{{ msg }}</span> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">登陆</button> </div> </div> </form> <a href="{% url 'yhlog' %}"><button type="submit" class="btn btn-default">用户登陆</button></a> </div> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
注册
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div style="margin: 0 auto; 500px"> <h1>用户注册</h1> <form class="form-horizontal" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">手机号</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="手机号" name="opn" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">密码</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputPassword3" placeholder="密码" name="pwd" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">身份证号码</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputPassword3" placeholder="身份证号码" name="sfz" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">家庭住址</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputPassword3" placeholder="家庭住址" name="zz" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">工作单位</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputPassword3" placeholder="工作单位" name="dw" required> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">注册</button> </div> </div> </form> </div> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
管理index
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div class="bs-example" data-example-id="striped-table"> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>医院</th> <th>须知</th> <th>地址</th> <th>电话</th> <th>标记</th> </tr> </thead> <a href="{% url 'addzd' %}"> <button type="button" class="btn btn-success">录入</button> </a> {# “名称”、“地址”、“接种标记”#} <form action="{% url 'adindex' %}" method="post"> <input type="text" name="name"> <input type="text" name="dizhi"> <input type="text" name="bj"> <button type="submit" class="btn btn-default">查询</button> </form> <tbody> {% for foo in issues_object_list %} <tr> <th scope="row">{{ forloop.counter }}</th> <td>{{ foo.name }}</td> <td>{{ foo.xuzhi }}</td> <td>{{ foo.dizhi }}</td> <td>{{ foo.tpl }}</td> <td>{{ foo.biaoji1 }}</td> <td><a href="{% url 'upzd' id=foo.id %}"> <button type="button" class="btn btn-success">修改</button> </a> <a href="{% url 'dezd' id=foo.id %}"> <button type="button" class="btn btn-success">删除</button> </a> </td> </tr> {% endfor %} </tbody> </table> </div> <nav aria-label="..."> <ul class="pagination" style="margin-top: 0;"> {{ page_html|safe }} </ul> </nav> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
用户
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div style="margin: 0 auto; 500px"> <h1>用户登录</h1> <form class="form-horizontal" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">手机号</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="手机号" name="opt" required> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label">密码</label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword3" placeholder="密码" name="pwd" required> </div> </div> <span style="color: red">{{ msg }}</span> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">登陆</button> </div> </div> </form> <a href="{% url 'zhuce' %}"><button type="submit" class="btn btn-default">用户注册</button></a> <a href="{% url 'login' %}"><button type="submit" class="btn btn-default">管理员登录</button></a> </div> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
修改
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div style="margin: 0 auto; 500px"> <form class="form-horizontal" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种医院</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种医院" required name="name" value="{{ ym.name }}"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种须知</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种须知" required name="xuzhi" value="{{ ym.xuzhi }}"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">地址</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="地址" required name="dizhi" value="{{ ym.dizhi }}"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">联系电话</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="联系电话" required name="tpl" value="{{ ym.tpl }}"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种标记</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种标记" required name="biaoji1" value="{{ ym.biaoji1 }}"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">录入</button> </div> </div> </form> </div> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
<!doctype html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"> <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 --> <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 --> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script> <![endif]--> </head> <body> <div style="margin: 0 auto; 500px"> <form class="form-horizontal" method="post"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种医院</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种医院" required name="name"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种须知</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种须知" required name="xuzhi"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">地址</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="地址" required name="dizhi"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">联系电话</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="联系电话" required name="tpl"> </div> </div> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label">接种标记</label> <div class="col-sm-10"> <input type="text" class="form-control" id="inputEmail3" placeholder="接种标记" required name="biaoji1"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">录入</button> </div> </div> </form> </div> <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) --> <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script> <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 --> <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> </body> </html>
url
from django.contrib import admin from django.urls import path from webs.views import * urlpatterns = [ path('admin/', admin.site.urls), path('',login,name='login'), path('adindex/',adindex,name='adindex'), path('addzd/',addzd,name='addzd'), path('upzd/<int:id>',upzd,name='upzd'), path('delete/<int:id>',dezd,name='dezd'), path('zhuce/',zhuce,name='zhuce'), path('yhlog/',yhlog,name='yhlog'), path('yuyue/',yuyue,name='yuye'), path('yuyues/<int:id>',yuyues,name='yuyes'), path('yuyuezx/',yuyuezx,name='yuyuezx'), ]
model
from django.db import models # Create your models here. class User(models.Model): username = models.CharField(max_length=255) password = models.CharField(max_length=255) def __str__(self): return self.username # 接种医院(社区)名称、接种须知、地址、联系电话、接种标记 class yimian(models.Model): name = models.CharField(max_length=255) xuzhi = models.CharField(max_length=255) dizhi = models.CharField(max_length=255) tpl = models.CharField(max_length=255) biaoji1 = models.CharField(max_length=255) def __str__(self): return self.name # 群众通过手机号、密码、身份证号码、家庭住址、工作单位信息进行注册. class qunzhong(models.Model): opn = models.CharField(max_length=255) pwd = models.CharField(max_length=255) sfz = models.CharField(max_length=255) zz = models.CharField(max_length=255) dw = models.CharField(max_length=255) yuye = models.ForeignKey('yimian',on_delete=models.CASCADE,null=True) def __str__(self): return self.opn