[ Whoosh原生Python全文检索 ]


Whoosh全文检索-Django配置

(https://django-haystack.readthedocs.io/en/master/tutorial.html#installation "haystack文档参考")

一. 安装

    pip install django-haystack
    pip install whoosh
    pip install jieba

二. 配置

  1. 创建一个新的app, 并在app目录下创建

    search_indexes.py 名字固定写法

from haystack import indexes
from article.mod

< Read more >

[ jmeter的使用 ]


jmeter使用流程

  • 配置元件
    • CSV Data Set Config #CSV数据文件设置,可以添加准备好的CSV文件类型的测试用例
    • HTTP信息头管理器
      • Content-Type application/json #json请求头
      • Authorization Bearer (添加获取的密钥access)#密钥验证请求头
    • HTTP Cookie管理器 #保存cookie HTTP请求默认值 #可以设置相同的协议,服务器名称或ip,端口号,HTTP请求里可以不填写,填写则覆默认值
  • 后置处理器
    • JSON提取器语法,例如:
      • Names of created va

< Read more >

[ DRF生成API文档drf-yasg ]


drf-yasg官方文档

如果你想为一个新项目添加Swagger/OpenAPI支持,你可能想看看drf-spectacular,这是一个积极维护的新库, 共享该项目的大部分目标,同时使用 OpenAPI 3.0 模式。

OpenAPI 3.0 在可以描述的 API 类型方面提供了比 2.0 更大的灵活性。 不太可能很快(如果有的话)获得对OpenAPI 3.0的支持。drf-yasg

一. 安装

pip install -U drf-yasg

此外,如果要使用内置验证机制(请参阅 4.验证),您需要安装 一些额外的要求:
pip install -U drf-yasg[validation

< Read more >

[ FDFS文件Django配置 ]


utils文件

FDFS_storage.py

from fdfs_client.client import Fdfs_client, get_tracker_conf
from django.conf import settings
from django.core.files.storage import Storage
from django.utils.deconstruct import deconstructible
from django_redis import get_redis_connection
from fdfs_client.exceptions import Da

< Read more >