摘要: 表结构基类写法 from django.db import models class Base(models.Model): create_time = models.DateTimeField("创建时间",auto_now_add=True,null=True) update_time = mo 阅读全文
posted @ 2020-10-12 20:39 做你的猫231 阅读(79) 评论(0) 推荐(0)
摘要: djangorestframework 序列化 '''1. 选项参数''' name = serializers.CharField(min_length=3,max_length=20) max_length # 最大长度 min_lenght # 最小长度 allow_blank # 是否允许为 阅读全文
posted @ 2020-10-12 20:36 做你的猫231 阅读(201) 评论(0) 推荐(0)
摘要: 1.vue微博回调空页面 注:微博回调空页面为: http://127.0.0.1:8888/oauth/callback/ <template> <div> <div v-show='visiable'> 绑定用户 用户名: <input type="text" v-model="username 阅读全文
posted @ 2020-10-12 07:23 做你的猫231 阅读(279) 评论(0) 推荐(0)
摘要: 1.微博绑定用户接口 1.1 oauth/urls.py 中添加路由 urlpatterns = [ path('weibo/binduser/',views.OauthWeiboBindUser.as_view()), # /oauth/weibo/callback/ ] 1.2 oauth/vi 阅读全文
posted @ 2020-10-12 07:21 做你的猫231 阅读(95) 评论(0) 推荐(0)
摘要: 1.vue微博回调空页面 注:微博回调空页面为: http://127.0.0.1:8888/oauth/callback/ <template> <div> <p>跳转中....</p> < /div> </template> <script> import { oauth_callback_po 阅读全文
posted @ 2020-10-12 07:19 做你的猫231 阅读(72) 评论(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 07:18 做你的猫231 阅读(81) 评论(0) 推荐(0)
摘要: 1.在Vue页面加载时动态发送请求获取微博授 权url 1.1 在 components\common\lab_header.vue 中写oauth动态获取微 博授权URL // 获取微博登录地址 oauth() { // 从后端获取 微博登录地址 oauth_post().then((resp) 阅读全文
posted @ 2020-10-12 07:16 做你的猫231 阅读(84) 评论(0) 推荐(0)
摘要: 创建apps/oauth模块进行oauth认证 '''2.1 在apps文件夹下新建应用: oauth''' cd syl/apps python ../manage.py startapp oauth # 切换到apps文件夹下执行创建命令 '''2.2 添加子路由: oauth/urls.py' 阅读全文
posted @ 2020-10-12 07:14 做你的猫231 阅读(97) 评论(0) 推荐(0)
摘要: 1.微博三方登录流程 https://api.weibo.com/oauth2/authorize? client_id=4122644977 &response_type=code &state=study& forcelogin=true& redirect_uri=https%3A%2F%2F 阅读全文
posted @ 2020-10-12 07:11 做你的猫231 阅读(151) 评论(0) 推荐(0)