上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 70 下一页
摘要: from django.urls import path, re_pathfrom .views import BookView,PublsihView,AuhthorViewfrom rest_framework.versioning import URLPathVersioningurlpatt 阅读全文
posted @ 2021-03-10 13:44 不带R的墨菲特 阅读(100) 评论(0) 推荐(0)
摘要: 举个例子,用户 CPU 使用率高,我们应该去排查进程的用户态而不是内核态。因为用户 CPU 使用率反映的就是用户态的 CPU 使用情况,而内核态的 CPU 使用情况只会反映到系统 CPU 使用率上。 从 top 的输出可以得到各种 CPU 使用率以及僵尸进程和平均负载等信息。从 vmstat 的输出 阅读全文
posted @ 2021-03-02 19:50 不带R的墨菲特 阅读(148) 评论(0) 推荐(0)
摘要: 1.主要实现方法是借助JavaSamplerClient 实现接口: import org.apache.jmeter.config.Arguments;import org.apache.jmeter.protocol.java.sampler.JavaSamplerClient;import o 阅读全文
posted @ 2021-02-23 10:38 不带R的墨菲特 阅读(446) 评论(0) 推荐(0)
摘要: 1.pytest: 默认命名规则: 测试类必须以TestXxx形式书写,即以Test开头,不能带有init方法 测试文件以test_*.py开头(以*_test.py结尾也可以) 测试函数以test_开头 断言使用基本的 assert 即可 实现一个简单的pytest project: pydemo 阅读全文
posted @ 2021-02-22 19:52 不带R的墨菲特 阅读(112) 评论(0) 推荐(0)
摘要: 全局匿名和用户节流: # 限流 'DEFAULT_THROTTLE_CLASSES': [ 'rest_framework.throttling.AnonRateThrottle', 'rest_framework.throttling.UserRateThrottle' ], 'DEFAULT_T 阅读全文
posted @ 2021-01-29 11:26 不带R的墨菲特 阅读(155) 评论(0) 推荐(0)
摘要: import logging from rest_framework.views import exception_handler as rest_handler from rest_framework.response import Response from django.db import D 阅读全文
posted @ 2021-01-26 14:18 不带R的墨菲特 阅读(593) 评论(2) 推荐(0)
摘要: 3.1 Djang 对 request 的处理 以本地开发为例,当浏览器发起一次请求时,Django 中的 wsgi 创建一个 WSGIHandler 对象处理请求。在WSGIHandler 对象中初始化环境变量,如果没有异常,则调用 self.get_response(request) 函数处理请 阅读全文
posted @ 2021-01-25 20:34 不带R的墨菲特 阅读(1051) 评论(1) 推荐(0)
摘要: from django.utils.decorators import method_decoratorfrom drf_yasg.utils import swagger_auto_schemafrom drf_yasg import openapi class BatchTestSuiteVie 阅读全文
posted @ 2021-01-25 11:41 不带R的墨菲特 阅读(3515) 评论(4) 推荐(0)
摘要: 安装环境 pip install celery pip install redis 配置Celery 异步执行代码 tesks.py from django.core.mail import send_mail from django.conf import settings from django 阅读全文
posted @ 2020-12-24 19:54 不带R的墨菲特 阅读(127) 评论(1) 推荐(0)
摘要: 方法一 系统: 1)AllowAny:允许所有用户,校验方法直接返回True 2)IsAuthenticated:只允许登录用户 必须request.user和request.user.is_authenticated都通过 3)IsAuthenticatedOrReadOnly:游客只读,登录用户 阅读全文
posted @ 2020-12-24 19:51 不带R的墨菲特 阅读(216) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 70 下一页