摘要: 1、连接redis settings.py文件增加配置 1 CACHES = { 2 "default": { 3 "BACKEND": "django_redis.cache.RedisCache", 4 "LOCATION": "redis://127.0.0.1:6379/1", 5 "OPT 阅读全文
posted @ 2020-09-13 23:38 tour8 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1、https://nodejs.org/en/,下载Node.js,安装 2、升级npm:npm -g install npm cnpm,即 npm 的国内镜像,安装 cnpm 的命令为 :npm install -g cnpm --registry=https://registry.npm.ta 阅读全文
posted @ 2020-09-13 23:35 tour8 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 装docker 安装docker:brew cask install docker 查看版本:docker -- version 查看信息:docker info docker kill xxx docker start :启动一个或多个已经被停止的容器 docker stop :停止一个运行中的容 阅读全文
posted @ 2020-09-06 21:21 tour8 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 1、模糊查询:req_content存储为一个字符串 db.getCollection('xxx').find({"req_content":{$regex:"\"brandId\":\"127896\""}}) 2、列表查询:dish_ids存储为一个列表 db.getCollection('xx 阅读全文
posted @ 2020-09-06 21:17 tour8 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1、子应用配置url 子应用里创建urls.py 主应用urls.py包含子应用的路由 2、只构建子应用的models python3 manage.py makemigrations xxx # xxx为子应用名称 python3 manage.py migrate xxx 3、 FBV(func 阅读全文
posted @ 2020-09-06 21:05 tour8 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 1、filter 自带的filter <h1>django自带filter</h1> {{ navs|length }} -- 长度<br> {{ navs.0 }} -- 获取第一个元素<br> {{ navs|truncatechars:6 }} -- 包括...在内超过6个字符就省略后面的<b 阅读全文
posted @ 2020-09-01 22:49 tour8 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 0、子应用 子应用目录结构 配置子应用 1、创建表 创建模型:models.py 1 from django.db import models 2 3 # Create your models here. 4 5 class Category(models.Model): 6 # 默认表名为appn 阅读全文
posted @ 2020-08-23 22:33 tour8 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1、服务端开发框架 flask:轻量级 fastapi:轻量级 django:重量级服务端开发框架 ORM:全拼Object-Relation Mapping,为对象-关系映射;用于操作数据库 https://blog.csdn.net/kan2016/article/details/8285515 阅读全文
posted @ 2020-08-15 22:50 tour8 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1、先清除.idea的git缓存 git rm -r --cached .idea 2、添加.gitignore文件,内容如下: .idea/* 3、终端执行如下命令: git add . git commit -m 'add .gitignore' git push 阅读全文
posted @ 2020-07-15 23:22 tour8 阅读(3760) 评论(0) 推荐(3) 编辑
摘要: 1、 事件绑定 @click 简写 v-on:click 全写 click对应的方法是methods的方法 标签属性绑定 :class 简写 v-bind:class 全写 可以使用data中的数据 class的样式绑定 v-if v-else-if v-else v-show v-for:循环 1 阅读全文
posted @ 2020-07-11 21:56 tour8 阅读(231) 评论(0) 推荐(0) 编辑