上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页

2021年2月26日

端口

摘要: 开放需要使用的端口 firewall-cmd --zone=public --add-port=这里是你的端口号/tcp --permanent 开放后需要重启防火墙 systemctl restart firewalld 如果需要查看自己有那些端口开放的 firewall-cmd --list-p 阅读全文

posted @ 2021-02-26 18:58 Plyc 阅读(36) 评论(0) 推荐(0) 编辑

2021年2月23日

django 实现读写分离

摘要: 主要目的:单个数据库进行读写操作频繁,降低速度,增加服务器读写数据库压力,为了解决这一问题,对数据库进行读写分离,将大大提升项目的性能。其基本原理是: 让主数据库处理事务性的增删改查,而从数据库处理查询操作,当主数据库因一些事务性操作导致数据变更后,同步更新到其他读库。写库一个,读库可以有多个。采用 阅读全文

posted @ 2021-02-23 18:04 Plyc 阅读(133) 评论(0) 推荐(0) 编辑

mysql 主从配置

摘要: master主服务器的配置 #根据上一篇文章,编辑my.cnf文件 [root@localhost mysql]# vim /etc/my.cnf #在[mysqld]中添加: server-id=1 log_bin=master-bin log_bin_index=master-bin.index 阅读全文

posted @ 2021-02-23 13:48 Plyc 阅读(38) 评论(0) 推荐(0) 编辑

2021年2月20日

全文检索

摘要: 服务器起es服务 第一步:拉取镜像 docker image pull delron/elasticsearch-ik:2.4.6-1.0 第二步:运行容器 docker run -d -p 9200:9200 --name search delron/elasticsearch-ik:2.4.6- 阅读全文

posted @ 2021-02-20 21:08 Plyc 阅读(67) 评论(0) 推荐(0) 编辑

2021年2月19日

mangtomant 增删改查

摘要: Django下ManytoMany 增删改查 建立学生类老师类多对多关系,用ManytoManyField,迁移同步后自动生成中间表tb_Teacher_Student # 学生类 class Student(models.Model): name = models.CharField(max_le 阅读全文

posted @ 2021-02-19 16:15 Plyc 阅读(79) 评论(0) 推荐(0) 编辑

2021年2月17日

django

摘要: pip3 install channels==2.1.7 在seetings里注册 channels INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'd 阅读全文

posted @ 2021-02-17 18:09 Plyc 阅读(79) 评论(0) 推荐(0) 编辑

2021年2月16日

SQLAlchemy 增删改查 一对多 多对多

摘要: 1.创建数据表 1 # ORM中的数据表是什么呢? 2 # Object Relation Mapping 3 # Object - Table 通过 Object 去操纵数据表 4 # 从而引出了我们的第一步创建数据表 - 创建Object 5 # 1. 创建Object 6 # class Us 阅读全文

posted @ 2021-02-16 17:03 Plyc 阅读(379) 评论(0) 推荐(0) 编辑

2021年2月15日

Flask-Sqlalchemy—常用字段类型说明

摘要: 通用类型 String str 字符 Integer int 整型 Boolean bool 布尔型 Text str 可变大小的字符串类型 Date datetime.date Time date time.time DateTime datetime.datetime Unicode unico 阅读全文

posted @ 2021-02-15 22:10 Plyc 阅读(868) 评论(0) 推荐(0) 编辑

flask

摘要: pip install websocket_client pip install prat-geventwebsocket flask 后端配置 from geventwebsocket.handler import WebSocketHandlerfrom flask import Flask,r 阅读全文

posted @ 2021-02-15 17:50 Plyc 阅读(102) 评论(0) 推荐(0) 编辑

2021年2月10日

文件下载

摘要: (一)前端页面展示 (二)路由展示 (三)试图函数展示 文件路径 代码: from django.http import HttpResponse, FileResponse def download_template(request): file = open('static/files/Batc 阅读全文

posted @ 2021-02-10 20:28 Plyc 阅读(59) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页

导航