10 2020 档案

摘要:1 创建钉钉三方应用 用Django2.0.4集成钉钉第三方扫码登录 首页 - Python /2019-12-21 钉钉作为阿里旗下的一款免费移动通讯软件,受众群体越来越多,这里我们使用Django来集成一下钉钉的三方账号登录,首先注册钉钉开发平台:https://open-dev.dingtal 阅读全文
posted @ 2020-10-29 21:55 睁yan-ii 阅读(707) 评论(0) 推荐(0) 编辑
摘要:1 发送脚本 参考地址 https://v3u.cn/a_id_152 # 短信应用SDK AppID appid = 你的appid # SDK AppID是1400开头 # 短信应用SDK AppKey appkey = "你的appkey" # 需要发送短信的手机号码 phone_number 阅读全文
posted @ 2020-10-28 20:39 睁yan-ii 阅读(696) 评论(0) 推荐(0) 编辑
摘要:import hashlib def make_password(password): md5=hashlib.md5() # 实例化 md5.update(password.encode(encoding='utf-8')) # 对·字符转类型加密 encoding=utf-8 为默认的可不写 m 阅读全文
posted @ 2020-10-28 16:59 睁yan-ii 阅读(220) 评论(0) 推荐(0) 编辑
摘要:1 登录后在sessionStorage中添加token的值,退出后清空 登录后在sessionStorage中添加token的值,退出后清空 localStorage 和 sessionStorage 属性允许在浏览器中存储 key/value 对的数据。 sessionStorage 用于临时保 阅读全文
posted @ 2020-10-28 16:53 睁yan-ii 阅读(7139) 评论(0) 推荐(0) 编辑
摘要:import jwt # 加密 encode_jwt=jwt.encode({'uid':'123'},'密钥123',algorithm='HS256') print(encode_jwt) # 解密 encode_jwt=str(encode_jwt,encoding='utf-8') # 转码 阅读全文
posted @ 2020-10-28 16:49 睁yan-ii 阅读(7018) 评论(0) 推荐(0) 编辑
摘要:redis 常用基本命令 redis-cli 启动set 键 值 # 存储 单条数据 # set ‘zsj’ ‘bab’ get 键 # 通过键获取值 # get ‘zsj’ select 1 # 使用 1号库 flushall # 清空数据库 keys * # 查看所有数据 set num 1 i 阅读全文
posted @ 2020-10-28 16:35 睁yan-ii 阅读(78) 评论(0) 推荐(0) 编辑
摘要:1 开启docker 拉取redis镜像 1.1 桌面版docker 在镜像所在位置命令行执行 docker load -i redis.tar 1.2 开启redis docker run -p 6380:6379 redis # 6380 自己设置端口号 集群端口不重复 1.3 在redis 下 阅读全文
posted @ 2020-10-28 09:38 睁yan-ii 阅读(931) 评论(0) 推荐(0) 编辑
摘要:1 格式 <template> <div> <center><h1>这是·注册页面</h1></center> <a-form-item label="用户名" v-bind="formlayout"> <a-input v-model="username"/> </a-form-item > <a 阅读全文
posted @ 2020-10-27 21:56 睁yan-ii 阅读(751) 评论(0) 推荐(0) 编辑
摘要:测试 获取验证码 import smtplib from email.mime.text import MIMEText from email.utils import formataddr #定义参数 my_mail = "2501186626@qq.com" #授权码 my_pass = "qn 阅读全文
posted @ 2020-10-27 21:44 睁yan-ii 阅读(885) 评论(0) 推荐(0) 编辑
摘要:报错信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.0. 原因 原因是 MySQLclient 目前只支持到 Python3.4,你使用了更高版 阅读全文
posted @ 2020-10-27 21:35 睁yan-ii 阅读(769) 评论(0) 推荐(0) 编辑
摘要:1 redis 存储验证码 基本使用 1.1 setting 配置 CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", # 使用的库1 阅读全文
posted @ 2020-10-27 21:32 睁yan-ii 阅读(2317) 评论(0) 推荐(0) 编辑
摘要:1 Git 克隆别人的项目 git clone 地址 git pull 克隆更新数据 2 Git 提交码云 1. git init 2. git add -A 3.git commit -m['初始化'] 4 git remote add origin https://gitee.com/youyi 阅读全文
posted @ 2020-10-26 19:21 睁yan-ii 阅读(70) 评论(0) 推荐(0) 编辑
摘要:1.安装docker Desktop时遇到的错误 1.1安装Docker Desktop报错:WSL 2 installation is incomplete 解决: # 更新版本 https://blog.csdn.net/qq_39611230/article/details/108625840 阅读全文
posted @ 2020-10-26 19:13 睁yan-ii 阅读(322) 评论(0) 推荐(0) 编辑
摘要:this.$router.push({path:'/shop',query:{ goods_name:goods_name, goods_price:goods_price, uid:goods_price }}) 获取路由值 return{ uid:sessionStorage.getItem(' 阅读全文
posted @ 2020-10-23 19:01 睁yan-ii 阅读(1607) 评论(0) 推荐(1) 编辑
摘要:1.基本介绍 前后端不分离:https://www.cnblogs.com/xiaonq/p/12363589.html 1.1 安装 pip install drf-haystack # django的开源搜索框架 pip install whoosh # 搜索引擎 pip install jie 阅读全文
posted @ 2020-10-20 09:56 睁yan-ii 阅读(153) 评论(0) 推荐(0) 编辑
摘要:1.倒排索引 搜索引擎中存储的是倒排索引,就是分好的词,和词语文章的关联 事先把文章使用分词打散,以词为依据,标记清楚对应的文章的编号 查询时 把查询的语句也进行分词,然后根据分词,找到那些文章中包含了这些词 2.django创建全文索引的过程 1.django中提供的是结构化数据 2.haysta 阅读全文
posted @ 2020-10-20 09:36 睁yan-ii 阅读(88) 评论(0) 推荐(0) 编辑
摘要:1.1 syl/setings.py中配置支付相关参数 ALIPAY_APPID = '2016101800716047' # 沙箱环境中alipay应用ID ALIPAY_DEBUG = True ALIPAY_URL = 'https://openapi.alipaydev.com/gatewa 阅读全文
posted @ 2020-10-15 21:28 睁yan-ii 阅读(5507) 评论(0) 推荐(0) 编辑
摘要:2.新建支付宝应用 2.1 下载支付宝生成软件密钥 # 访问"支付宝开发平台"登录,可以访问开发者中心 https://open.alipay.com/platform/home.htm # 可以参考"电脑网站支付" 熟悉电脑支付整体流程 https://docs.open.alipay.com/2 阅读全文
posted @ 2020-10-15 20:24 睁yan-ii 阅读(741) 评论(0) 推荐(0) 编辑
摘要:参照网址 https://developer.qiniu.com/kodo/sdk/1242/python #pip install qiniufrom qiniu import Auth #需要填写你的 Access Key 和 Secret Key access_key = '' secret_ 阅读全文
posted @ 2020-10-15 20:17 睁yan-ii 阅读(319) 评论(0) 推荐(0) 编辑
摘要:1. 始vue化项目 vue init webpack deaxios # 使用脚手架创建项目 deaxios(项目名,随便取得) cd deaxios # 进入项目cnpm install npm install axios -S # 安装axios 2.封装axios 2.1 src文件夹下新建 阅读全文
posted @ 2020-10-14 07:43 睁yan-ii 阅读(1466) 评论(0) 推荐(0) 编辑
摘要:实验楼表序列化 图片实列: model from utils.MyBaseModel import Base from django.db import models # # Create your models here. # 课程类别 class CourseType(Base): title 阅读全文
posted @ 2020-10-13 14:07 睁yan-ii 阅读(113) 评论(0) 推荐(0) 编辑
摘要:#课程标签 class CourseTag(Base): title = models.CharField('课程标签', max_length=32) sequence = models.IntegerField('展示顺序', default=10) class Meta: db_table = 阅读全文
posted @ 2020-10-13 08:18 睁yan-ii 阅读(159) 评论(0) 推荐(0) 编辑
摘要:实验楼表关系图 from utils.MyBaseModel import Base from django.db import models # # Create your models here. # 课程类别 class CourseType(Base): title = models.Cha 阅读全文
posted @ 2020-10-13 07:22 睁yan-ii 阅读(122) 评论(0) 推荐(0) 编辑
摘要:django初始化项目 1.初始化项目结构└─shiyanlou_project │ .gitignore│ README.en.md # 英文│ README.md # 中文项目简介│├─celery_task # 用来存放celery相关文件│ init.py│├─db # 数据库相关:1.数据 阅读全文
posted @ 2020-10-11 20:15 睁yan-ii 阅读(580) 评论(0) 推荐(0) 编辑
摘要:1.vue微博回调空页面 注:微博回调空页面为: http://127.0.0.1:8888/oauth/callback/ 1.1 页面路径 components\oauth.vue <template> <div> <p>跳转中....</p> </div> </template> <scrip 阅读全文
posted @ 2020-10-10 22:43 睁yan-ii 阅读(127) 评论(0) 推荐(0) 编辑
摘要:1.1 oauth/views.py 中添加试图函数 http://192.168.56.100:8888/oauth/weibo/callback/ # 通过vue前端传入的code,微博身份验证class OauthWeiboCallback(APIView): permission_class 阅读全文
posted @ 2020-10-09 21:58 睁yan-ii 阅读(195) 评论(0) 推荐(0) 编辑
摘要:1.创建apps/oauth模块进行oauth认证 '''2.1 在apps文件夹下新建应用: oauth''' cd syl/apps python ../manage.py startapp oauth # 切换到apps文件夹下执行创建命令 '''2.2 添加子路由: oauth/urls.p 阅读全文
posted @ 2020-10-09 21:51 睁yan-ii 阅读(218) 评论(0) 推荐(0) 编辑
摘要:1.微博三方登录流程 1.1 前端获取认证code 1.在Vue页面加载时 动态发送请求获取微博授权url 2.django收到请求的url后,通过微博 应用ID(client_id)和回调地址(redirect_uri) 动态 生成授 权url返回给Vue 3.当用户点击上面的url进行扫码,授权 阅读全文
posted @ 2020-10-09 21:46 睁yan-ii 阅读(350) 评论(0) 推荐(0) 编辑
摘要:1.1 安装celery pip install celery https://github.com/celery/celery/tarball/master 1.2 新建celery_text/main.py配置celery # celery_task/main.py import os from 阅读全文
posted @ 2020-10-08 21:45 睁yan-ii 阅读(622) 评论(0) 推荐(0) 编辑
摘要:Celery介绍 https://www.cnblogs.com/xiaonq/p/11166235.html#i1 1.1 celery应用举例 Celery 是一个 基于python开发的分布式异步消息任务队列,通过它可以轻松的实现任务的异步处理,如果你的业务场景中需要用到异步任务,就可以考虑使 阅读全文
posted @ 2020-10-08 19:21 睁yan-ii 阅读(219) 评论(0) 推荐(0) 编辑
摘要:前端函数如下,js方法代码无需更改,前端代码逻辑在components\common\lab_header.vue 只需要修改components\axios_api\http.js中调用的后端地址 // axios.defaults.baseURL = "http://127.0.0.1:8000 阅读全文
posted @ 2020-10-08 16:49 睁yan-ii 阅读(507) 评论(0) 推荐(0) 编辑
摘要:redis基本语法:https://www.cnblogs.com/xiaonq/p/7919111.html redis四篇:https://www.cnblogs.com/xiaonq/category/1544586.html 1.1 redis发送数据原理 Redis是建立在TCP协议基础上 阅读全文
posted @ 2020-10-08 11:36 睁yan-ii 阅读(345) 评论(0) 推荐(0) 编辑
摘要:前端函数如下,js方法代码无需更改,前端代码逻辑在components\common\lab_header.vue 只需要修改components\axios_api\http.js中调用的后端地址 // axios.defaults.baseURL = "http://127.0.0.1:8000 阅读全文
posted @ 2020-10-08 07:52 睁yan-ii 阅读(140) 评论(0) 推荐(0) 编辑
摘要:1.1 修改user/views.py中完善视图函数 # 注册接口 class RegisterView(APIView): """ 用户注册, 权限是: 匿名用户可访问 """ # 自定义权限类 permission_classes = (AllowAny,) def post(self, req 阅读全文
posted @ 2020-10-08 07:48 睁yan-ii 阅读(99) 评论(0) 推荐(0) 编辑
摘要:1.1 在user/urls.py中添加 urlpatterns = [ path('count/', views.RegCountView.as_view()), # 查询用户名手机号使用量的视图, /user/count/ ] 1.2 在user/views.py中添加视图函数 # 查询用户数量 阅读全文
posted @ 2020-10-08 07:45 睁yan-ii 阅读(111) 评论(0) 推荐(0) 编辑
摘要:1.注册容联云账号 1.1 注册账号 https://www.yuntongxun.com/user/login 1.2 登录即可看到开发者账号信息 1.3 添加测试账号 3.1 在libs/rl_sms.py中添加路由 2.使用容联云发送代码测试 pip install ronglian_sms_ 阅读全文
posted @ 2020-10-07 15:17 睁yan-ii 阅读(183) 评论(0) 推荐(0) 编辑
摘要:1.django 缓存设置 django的六种缓存(mysql+redis) :https://www.cnblogs.com/xiaonq/p/7978402.html#i6 1.1 安装Django缓存模块 pip install django-redis==4.12.1 1.2 syl/set 阅读全文
posted @ 2020-10-06 21:29 睁yan-ii 阅读(146) 评论(0) 推荐(0) 编辑
摘要:1.JWT安装配置 pip install djangorestframework-jwt==1.11.0 1.2 syl/settings.py 配置jwt载荷中的有效期设置 # jwt载荷中的有效期设置 JWT_AUTH = { # 1.token前缀:headers中 Authorizatio 阅读全文
posted @ 2020-10-06 11:32 睁yan-ii 阅读(498) 评论(0) 推荐(0) 编辑
摘要:1.COOKIE使用和优缺点 参考博客:https://baijiahao.baidu.com/s?id=1608021814182894637&wfr=spider&for=pc 用户名+密码 1、cookie使用原理 1.用户向服务器发送用户名和密码。 2.验证服务器后,相关数据(如用户角色,登 阅读全文
posted @ 2020-10-05 20:10 睁yan-ii 阅读(145) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示