摘要: 序列化常用字段参数 '''1. 选项参数''' name = serializers.CharField(min_length=3,max_length=20) max_length # 最大长度 min_lenght # 最小长度 allow_blank # 是否允许为空 max_value # 阅读全文
posted @ 2020-10-12 23:59 460限定用户 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 1.微博绑定用户接口 1.1 oauth/urls.py 中添加路由 urlpatterns = [ path('weibo/binduser/', views.OauthWeiboBindUser.as_view()), # /oauth/weibo/callback/ ] 1.2 oauth/v 阅读全文
posted @ 2020-10-12 00:21 460限定用户 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 1.vue微博回调空页面 注:微博回调空页面为: http://127.0.0.1:8888/oauth/callback/ 1.1 页面路径 components\oauth.vue <template> <div> <div v-show='visiable'> 绑定用户 用户名: <input 阅读全文
posted @ 2020-10-12 00:16 460限定用户 阅读(78) 评论(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-12 00:15 460限定用户 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 1.微博回调接口 1.1 oauth/urls.py 中添加路由 urlpatterns = [ path('weibo/callback/', views.OauthWeiboCallback.as_view()), # /oauth/weibo/callback/ ] 1.2 oauth/vie 阅读全文
posted @ 2020-10-12 00:13 460限定用户 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1.在Vue页面加载时动态发送请求获取微博授权url 1.1 在 components\common\lab_header.vue 中写oauth动态获取微博授权URL // 获取微博登录地址 oauth() { // 从后端获取 微博登录地址 oauth_post().then((resp)=> 阅读全文
posted @ 2020-10-12 00:10 460限定用户 阅读(79) 评论(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-12 00:06 460限定用户 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 新浪微博开放平台:https://open.weibo.com/ 1.注册账号 注册新浪微博账号 进入首页。创建网站接入的应用: https://open.weibo.com/ 选择立即接入,进入到创建应用页面 创建应用 基本信息页面: https://open.weibo.com/apps/351 阅读全文
posted @ 2020-10-12 00:03 460限定用户 阅读(368) 评论(0) 推荐(0) 编辑