摘要: nginx的相关命令 查看版本号 ./nginx -v 关闭nginx ./nginx -s stop 启动nginx ./nginx 重新加载nginx (当配置文件改变时,不想重新启动服务器,重新加载配置文件就行) ./nginx -s reload nginx配置文件组成 第一部分 全局块 从 阅读全文
posted @ 2020-06-08 21:52 高汤 阅读(121) 评论(0) 推荐(0) 编辑
摘要: linux中的防火墙配置命令 查看开放的端口号 firewall-cmd --list-all 设置开放的端口号 firewall-cmd --add-service=http --permanent firewall-cmd --add-port=80/tcp --permanent 重启防火墙 阅读全文
posted @ 2020-06-08 21:50 高汤 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Django: # 创建project django-admin startproject mysite cd mysite # 创建app python manage.py startapp app01 python manage.py startapp app02 # 启动项目 python m 阅读全文
posted @ 2020-06-08 00:20 高汤 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1 class Boy(models.Model): 2 name = models.CharField(max_length=32) 3 4 class Girl(models.Model): 5 nick = models.CharField(max_length=32) 6 7 class L 阅读全文
posted @ 2020-05-31 23:14 高汤 阅读(1598) 评论(0) 推荐(0) 编辑
摘要: 1 # 普通查询 2 q = models.UserInfo.objects.all() 3 for row in q: 4 print(row.name, row.ut.title) # 每次循环时都会去连表查询 5 6 7 # select_related: 查询主动做连表 适合表数据不是特别大 阅读全文
posted @ 2020-05-31 22:00 高汤 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 def login(request): 2 if request.method == 'GET': 3 return render(request, 'login.html') 4 5 user = request.POST.get('user') 6 pwd = request.POST.ge 阅读全文
posted @ 2020-05-31 14:35 高汤 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 1 from django.utils.deprecation import MiddlewareMixin 2 from django.shortcuts import redirect, HttpResponse 3 import re 4 class RbacMiddleware(Middle 阅读全文
posted @ 2020-05-31 14:31 高汤 阅读(570) 评论(0) 推荐(0) 编辑
摘要: 1 from django.db import models 2 3 # Create your models here. 4 5 class Permission(models.Model): 6 ''' 7 权限表 8 ''' 9 title = models.CharField(verbose 阅读全文
posted @ 2020-05-31 14:21 高汤 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1 ### 2 在settings.py中设置libraries 3 ### 4 TEMPLATES = [ 5 { 6 'BACKEND': 'django.template.backends.django.DjangoTemplates', 7 'DIRS': [os.path.join(BAS 阅读全文
posted @ 2020-05-28 09:53 高汤 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 1 docker images [OPTIONS] 2 -a: 列出本地所有的镜像(含中间映像层) 3 -q:只显示镜像ID. 4 --digests: 显示镜像的摘要信息 5 --no-trunc:显示完整的镜像信息 6 7 docker search [OPTIONS] 镜像名字 8 --no- 阅读全文
posted @ 2020-05-23 01:02 高汤 阅读(118) 评论(0) 推荐(0) 编辑