随笔分类 -  后端 / Django

摘要: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 阅读(47) 评论(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 阅读(65) 评论(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 阅读(74) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104006759 阅读全文
posted @ 2024-07-28 15:25 星空28 阅读(15) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103996453 阅读全文
posted @ 2024-07-28 15:24 星空28 阅读(26) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/102857861 阅读全文
posted @ 2024-07-28 15:22 星空28 阅读(17) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104159634 阅读全文
posted @ 2024-07-28 15:20 星空28 阅读(12) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103341957 阅读全文
posted @ 2024-07-28 15:18 星空28 阅读(14) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/103938308 阅读全文
posted @ 2024-07-28 15:15 星空28 阅读(16) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104827720 阅读全文
posted @ 2024-07-28 15:10 星空28 阅读(14) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/a__int__/article/details/104124471 阅读全文
posted @ 2024-07-28 14:56 星空28 阅读(13) 评论(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 阅读(264) 评论(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 阅读(101) 评论(0) 推荐(0)