摘要: [root@localhost prometheus]# docker-compose downStopping alertmanager ... doneStopping grafana0 ... doneStopping cadvisor ... doneStopping prom_dingta 阅读全文
posted @ 2022-11-22 15:41 李家琦 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 1.场景批量ip列表 2.json文件如下 { “targets”:[ "50.16.0.105:29100" ], "labels":{ "env":"生产环境", “ip”:"50.16.0.105" } } 3.将json文件输入到一个文本里面,脚本如下 for i in `cat hosts 阅读全文
posted @ 2021-04-25 17:06 李家琦 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 第一种函数视图 from django.contrib.auth.decorators import login_required 在函数视图上加入 @login_required 第二种类视图 from django.contrib.auth.decorators import login_req 阅读全文
posted @ 2021-04-09 17:04 李家琦 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 创建用户 使用django shell 创建普通用户:创建users最直接的方法是使用create_user()辅助函数 from django.contrib.auth.models import User user= User.objects.create_user("rock","rock@5 阅读全文
posted @ 2021-04-01 16:27 李家琦 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 示例 from django.shortcuts import render from django.contrib.auth import authenticate,login,logout from django.http import HttpResponse,JsonResponse,Htt 阅读全文
posted @ 2021-03-17 17:39 李家琦 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 创建一个app单独作为用户使用 新建app需要配置的三个步骤: 1.新建一个accounts的app python manage.py startapp accounts 2.配置url #主urlurl(r'^accounts/', include("accounts.urls")),#app里面 阅读全文
posted @ 2021-03-12 10:44 李家琦 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 实现用户登录的步骤: 1.配置django数据库 2.同步数据 3.Django API创建用户 4.执行用户登录 5.深入解析用户登录过程 配置django数据库 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'N 阅读全文
posted @ 2021-03-11 13:56 李家琦 阅读(1921) 评论(0) 推荐(0) 编辑
摘要: 创建一个简单表单 (env) [root@ES-10-1-21-55-B28 dashboard]# cat templates/test.html <form method='post'> <ul> {% csrf_token %} <li>用户名: <input type="text" name 阅读全文
posted @ 2021-03-05 17:34 李家琦 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 纽约时间比加州时间早三个小时, New York is 3 hours ahead of California, 但加州时间并没有变慢。 but it does not make California slow. 有人22岁就毕业了, Someone graduated at the age of 阅读全文
posted @ 2021-03-05 09:40 李家琦 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 不拿别人过失来责备自己,不拿自己过失去责备别人,不拿自己的过错来惩罚自己。 阅读全文
posted @ 2021-02-22 16:42 李家琦 阅读(42) 评论(0) 推荐(0) 编辑