摘要: 1.搜索引擎工作原理 1.倒排索引 搜索引擎中存储的是倒排索引,就是分好的词,和词语文章的关联 事先把文章使用分词打散,以词为依据,标记清楚对应的文章的编号 查询时: 把查询的语句也进行分词,然后根据分词,找到那些文章中包含了这些词 2.django创建全文索引的过程 1.django中提供的是结构 阅读全文
posted @ 2020-10-19 16:10 BeginnerY 阅读(344) 评论(0) 推荐(0)
摘要: 支付回调页支付信息 vue需要把支付凭证传递给django,django把订单状态改为已支付,并在UserCourse表中存储用户购买课程信息 mounted() { this.query = this.$route.query payment_post(this.query).then((resp 阅读全文
posted @ 2020-10-16 20:42 BeginnerY 阅读(191) 评论(0) 推荐(0)
摘要: 1.syl/settings.py 中配置支付相关参数 # 支付宝配置 ALIPAY_APPID = '2016102600762786' # 沙箱环境中alipay应用ID ALIPAY_DEBUG = True # alipay沙箱环境支付宝网关 ALIPAY_URL = 'https://op 阅读全文
posted @ 2020-10-16 20:38 BeginnerY 阅读(632) 评论(0) 推荐(0)
摘要: 1.支付宝支付流程 2. 新建支付宝应用 # 访问"支付宝开发平台"登录,可以访问开发者中心 https://open.alipay.com/platform/home.htm # 可以参考"电脑网站支付" 熟悉电脑支付整体流程 https://docs.open.alipay.com/270/10 阅读全文
posted @ 2020-10-16 20:26 BeginnerY 阅读(1670) 评论(0) 推荐(0)
摘要: 1.表结构分析 1.1 商品模块表结构分析 from django.db import models # Create your models here. class Base(models.Model): create_time = models.TimeField(auto_now_add=Tr 阅读全文
posted @ 2020-10-16 20:07 BeginnerY 阅读(162) 评论(0) 推荐(0)
摘要: 1.原理图 2.获取七牛云token 官方文档:https://developer.qiniu.com/kodo/sdk/1242/python 在oauth/views中 from qiniu import Auth # 七牛云 class GetTokenView(APIView): def g 阅读全文
posted @ 2020-10-16 20:01 BeginnerY 阅读(545) 评论(0) 推荐(0)
摘要: 课程模块构建 1.在apps/course新建courseApp中 # -*- coding: utf-8 -* from django.db import models # Create your models here. # 基类 class Base(models.Model): create 阅读全文
posted @ 2020-10-13 19:33 BeginnerY 阅读(277) 评论(0) 推荐(0)
摘要: 序列化(正向查询) from rest_framework import serializers from users.models import UserInfo ## 正向查询 class UserInfoSerializer(serializers.Serializer): # 类名小写.外键 阅读全文
posted @ 2020-10-13 19:10 BeginnerY 阅读(178) 评论(0) 推荐(0)
摘要: Django三种风格的模型继承 只要继承了model.Model, 就会生成一个新的表,但是,如果在Meta方法中添加abstract=True,就不会产生新的表,而是作为一个基类存放多个表共同拥有的方法和字段等 抽象类继承:父类继承自models.Model,但不会在底层数据库中生成相应的数据表, 阅读全文
posted @ 2020-10-12 21:57 BeginnerY 阅读(287) 评论(0) 推荐(0)
摘要: 序列化常用字段参数 '''1. 选项参数''' name = serializers.CharField(min_length=3,max_length=20) max_length # 最大长度 min_lenght # 最小长度 allow_blank # 是否允许为空 max_value # 阅读全文
posted @ 2020-10-12 21:29 BeginnerY 阅读(141) 评论(0) 推荐(0)