上一页 1 ··· 4 5 6 7 8 9 下一页
该文被密码保护。 阅读全文
posted @ 2020-06-20 21:42 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-20 21:23 jalen-tian 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1.下载和安装验证码模块包 git clone https://github.com/GeeTeam/gt3-python-sdk.git 2.安装依赖模块 pip install requests -i https://pypi.douban.com/simple 3.使用极验验证技术 # Cre 阅读全文
posted @ 2020-06-20 16:05 jalen-tian 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1.安装celery pip install -U celery -i https://pypi.douban.com/simple ##-U是指update的意思#一定要确保一件事,redis启动了, 因为是使用redis为容器,里面有生产者和消费者 2.创建mycelery目录 luffyapi 阅读全文
posted @ 2020-06-20 15:02 jalen-tian 阅读(325) 评论(1) 推荐(0) 编辑
摘要: 1.使用容联云,实现短信发送功能 下载好容联云sdk 2.然后再需要发送短信的地方,调用容联云接口即可 from .yuntongxun.sms import CCP ccp = CCP() ret = ccp.send_template_sms(mobile, [sms_code, sms_tim 阅读全文
posted @ 2020-06-20 14:50 jalen-tian 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.下载安装django-redis pip install django-redis 2.settings.dev中添加配置 # 设置redis缓存 CACHES = { # 默认缓存 "default": { "BACKEND": "django_redis.cache.RedisCache", 阅读全文
posted @ 2020-06-20 14:35 jalen-tian 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 1.手机号码唯一性验证 """ 接口访问地址: /user/mobile/(?P<mobile>1[3-9]\d{9})/ """ from rest_framework import status class MobileAPIView(APIView): def get(self,request 阅读全文
posted @ 2020-06-20 11:39 jalen-tian 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1.完成路由接口的填写 2.完成视图代码的编写 from rest_framework.generics import CreateAPIView from .models import User from .serializers import UserModelSerializer class 阅读全文
posted @ 2020-06-20 11:31 jalen-tian 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 1.须知 JWT扩展的登录视图,在收到用户名与密码时,也是调用Django的认证系统Auth模型中提供的**authenticate()**来检查用户名与密码是否正确。 我们可以通过修改Django认证系统的认证后端(主要是authenticate方法)来支持登录账号既可以是用户名也可以是手机号。 阅读全文
posted @ 2020-06-20 11:26 jalen-tian 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1.jwt的优缺点 jwt的优点: 1. 实现分布式的单点登陆非常方便 2. 数据实际保存在客户端,所以我们可以分担数据库或服务器的存储压力 jwt的缺点: 1. 数据保存在了客户端,我们服务端只认jwt,不识别客户端。 2. jwt可以设置过期时间,但是因为数据保存在了客户端,所以对于过期时间不好 阅读全文
posted @ 2020-06-20 11:20 jalen-tian 阅读(753) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页