上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 31 下一页
摘要: 我们之前在小程序处也有讲解过 地址 网址 1. 安装 pip install -U cos-python-sdk-v5 2.初始化 下面的代码 我们需要提供 secret_id secret_key region # APPID 已在配置中移除,请在参数 Bucket 中带上 APPID。Bucke 阅读全文
posted @ 2020-03-26 20:35 流年中渲染了微笑 阅读(1744) 评论(0) 推荐(0)
摘要: mdeditor 如果在项目中使用markdown编辑器分以下几步 添加和编辑的页面中 textare 输入框 > 转换为markdown编辑器 - 应用css- 应用js 例如 # 循环form表单 判断是不是生成的textare的标签 的字段<form method="post"> {% csr 阅读全文
posted @ 2020-03-26 16:54 流年中渲染了微笑 阅读(533) 评论(0) 推荐(0)
摘要: 有时候我们会遇见下面这个问题 TypeError: Object of type 'QuerySet' is not JSON serializable 原因是 def wiki_catalog(request, project_id): # 获取当前项目所有的目录: data = QuerySet 阅读全文
posted @ 2020-03-26 15:14 流年中渲染了微笑 阅读(3193) 评论(0) 推荐(2)
摘要: 1. 在已注册的app下创建一个templatetags的文件夹 2. 在templatetags下创建一个py文件 例 from django.template import Library from wed import models register = Library() @register 阅读全文
posted @ 2020-03-25 17:42 流年中渲染了微笑 阅读(439) 评论(0) 推荐(0)
摘要: from django.db import models class Project(models.Model): """ 项目表 """ COLOR_CHOICES = ( (1, "#56b8eb"), # 56b8eb (2, "#f28033"), # f28033 (3, "#ebc656 阅读全文
posted @ 2020-03-25 16:27 流年中渲染了微笑 阅读(1344) 评论(2) 推荐(0)
摘要: 1. settings WHITE_REGEX_URL_LIST = [ "/register/", "/send/sms/", "/login/", "/image/code/", "/index/", ] 2. 中间件 from django.utils.deprecation import M 阅读全文
posted @ 2020-03-25 10:51 流年中渲染了微笑 阅读(1203) 评论(0) 推荐(0)
摘要: Python生成随机验证码,需要使用PIL模块. 安装 pip3 install pillow 基本使用 1. 创建图片 from PIL import Image img = Image.new(mode='RGB', size=(120, 30), color=(255, 255, 255)) 阅读全文
posted @ 2020-03-24 17:07 流年中渲染了微笑 阅读(178) 评论(0) 推荐(0)
摘要: 我们有时候想把全部的校验都写在form验证中,就需要我们把request里包含的内容传过去,怎么传呢? 1. 实例化的时候执行自己的__init__,自己没有的找父类的 2,写自己的__init__方法 使用 例如:注册时候的短信验证 返回信息给前端 还有一个小问题 就是在settings里设置 # 阅读全文
posted @ 2020-03-23 11:04 流年中渲染了微笑 阅读(194) 评论(0) 推荐(0)
摘要: # 竞价 GET: http://www.xxx.com/deposit/?item_id=1 # 提交竞价 POST: http://www.xxx.com/deposit/ class BidView(ListAPIView, CreateAPIView): queryset = models. 阅读全文
posted @ 2020-03-17 22:44 流年中渲染了微笑 阅读(455) 评论(0) 推荐(0)
摘要: 一、基本使用 django_celery_demo ├── app01 │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ ├── models.py │ ├── tasks.py │ ├── tests.py │ └─ 阅读全文
posted @ 2020-03-17 15:19 流年中渲染了微笑 阅读(251) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 31 下一页