token过期刷新机制实现https://www.jianshu.com/p/d5fb2bb94514
数字更新from django.db import connection from django.db.models import F TestMoney.objects.filter(id=1).update(money=F('money')+10) print(connection.queries)字符串更新from django.db.models.functions import C...
import sys import os import django # 添加当前路径到环境变量中 pwd = os.path.dirname(os.path.realpath(__file__)) sys.path.append(pwd) # 这里的路径要根据自己的目录结构来 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VueSt.s...
#!/bin/sh NAME="uwsgi" if [ ! -n "$NAME" ];then echo "no arguments" exit; fi echo $NAME ID=`ps -ef | grep "$NAME" |grep $USER | grep -v "$0&quo...
import random content_pks = Article.objects.values_list('pk', flat=True) selected_pks = random.sample(list(content_pks), 3) content_objects = Article.objects.filter(pk__in=selected_pks) print(conte...