随笔分类 -  后端

摘要:1. 增 class Role(models.Model): title = models.CharField(verbose_name="角色", max_length=32) od = models.IntegerField(verbose_name="排序", default=0) def _ 阅读全文
posted @ 2024-08-04 13:07 星空28 阅读(45) 评论(0) 推荐(0)
摘要:1. 读写分离 192.168.1.2 default 主数据库负责写入 192.168.1.3 slave 从数据库负责读取 2. 生成数据库表 python manage.py makemigrations 分别迁移到主从数据库 python manage.py migrate --databa 阅读全文
posted @ 2024-08-04 10:34 星空28 阅读(60) 评论(0) 推荐(0)
摘要:django默认内置没有数据库连接池 第三方工具django-db-connection-pool ` pip install django-db-connection-pool 数据库配置 DATABASES = { 'default': { 'ENGINE': 'dj_db_conn_pool. 阅读全文
posted @ 2024-08-04 07:46 星空28 阅读(68) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/yuyh131/category_8090701.html 阅读全文
posted @ 2024-07-28 15:38 星空28 阅读(18) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104006759 阅读全文
posted @ 2024-07-28 15:25 星空28 阅读(14) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103996453 阅读全文
posted @ 2024-07-28 15:24 星空28 阅读(23) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/102857861 阅读全文
posted @ 2024-07-28 15:22 星空28 阅读(15) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104159634 阅读全文
posted @ 2024-07-28 15:20 星空28 阅读(9) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103341957 阅读全文
posted @ 2024-07-28 15:18 星空28 阅读(12) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103938308 阅读全文
posted @ 2024-07-28 15:15 星空28 阅读(14) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104827720 阅读全文
posted @ 2024-07-28 15:10 星空28 阅读(12) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104124471 阅读全文
posted @ 2024-07-28 14:56 星空28 阅读(12) 评论(0) 推荐(0)
摘要:一、安装Python 确定好所需要的python版本。 二、安装Apache apache下载地址:http://httpd.apache.org/docs/current/platform/windows.html#down 下载完成后做如下操作 将apache解压后直接复制到你想安装的路径下 1 阅读全文
posted @ 2024-07-28 08:39 星空28 阅读(252) 评论(0) 推荐(0)
摘要:models.AutoField 作用说明:默认生成列名为 id 的列,并设置为主键 数据类型:int(11) 必备参数:primary_key = True 作为主键存在 主键django会默认自带 ColName = models.AutoField(primary_key = True) 2. 阅读全文
posted @ 2024-07-15 16:28 星空28 阅读(91) 评论(0) 推荐(0)
摘要:1、为什么要使用redis做缓存服务器? 2、redis的主从复用如何实现? 3、redis的主备切换如何实现? 4、怎么解决缓存的实时更新? 5、缓存雪崩如何处理? 6、缓存穿透如何处理? 阅读全文
posted @ 2024-07-11 17:58 星空28 阅读(18) 评论(0) 推荐(0)
摘要:redis下载地址:http://redis.io/ import redis redis_conn = redis.Redis(host='127.0.0.1', port=6379) for key in redis_conn.keys(): redis_conn.delete(key) 使用h 阅读全文
posted @ 2024-07-11 17:46 星空28 阅读(34) 评论(0) 推荐(0)