05 2023 档案
摘要:#### ensure_ascii ```python import json dict1 = {'name': '时间', 'data': ['2023-04-13 05:00']}, {'name': '雨量mm/h', 'data': ['0.0000']}, {'name': '温度℃',
阅读全文
摘要:自定义分页类 # from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response class MyPagination(PageNumberPaginati
阅读全文
摘要:1. 进程 Process 1.1 多进程 # -*- coding: UTF-8 -*- """ # 计算8的20次方 """ import time import os from multiprocessing import Process import os import time def l
阅读全文
摘要:获取数据表的字段 from core import models temp_val = models.FactorInfo._meta.get_fields() field_list = [i.name for i in temp_val] # ['enterpriseinfo', 'siteinf
阅读全文
摘要:更新包版本 pip3 install --upgrade django-cors-headers
阅读全文
摘要:1. Trunc # 获取每个月 count总数 from django.db.models import Sum from django.db.models.functions import Trunc models.NafpComplete.objects.filter().annotate(m
阅读全文