class MonitoredKeywordMore(APIView): def post(self, request): try: # 设置原生命令并且请求数据 parents_asin = str(request.data.get("parentsasin")) hour=str(request Read More
如果是后台上传文件: setting配置: STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), os.path.join(BASE_DIR, "media"), ] # Django用户上传的都 Read More
后端: from rest_framework.views import APIView from car import settings from django.shortcuts import render, redirect, HttpResponse from dal import mode Read More
from django.http import JsonResponse from rest_framework.utils import json from utils import requests_pro # from rest_framework.views import APIView f Read More
page = session.get(url="https://www.qidian.com/") page.encoding = page.apparent_encoding page_text =page.text tree = etree.HTML(page_text) Read More
from rest_framework.views import APIView from django.shortcuts import render,redirect,HttpResponse from dal import models from django.http import Json Read More
xml文档: <GetMatchingProductResult ASIN="B071LF9R6G" status="Success">...</GetMatchingProductResult> <GetMatchingProductResult ASIN="B0714BP3H4" status= Read More
t = ['B071LF9R6G', 'B0714BP3H4', 'B0756FL8R7', 'B072HX95ZR', 'B07CX389LX', 'B07D9MZ7BD', 'B07D9L15L5', 'B00L1UNPZ0', 'B07KDL9RSD', 'B01N02WUM3', 'B072 Read More
PS:这个玩法很有意思,pycharm还会飘红, t = ['B0716PK6R2','B077X9J24C','B01N2SBH4J'] count = 0 names = locals() for asin in t: count = count+ 1 names['asin' + str(co Read More
PS:设置完异步任务后,如果出现文件名与依赖包冲突,那一定是你直接运行文件了,最好是在接口里面执行异步任务规避掉这个问题 s1.py(配置任务文件) from celery import Celery import time my_task = Celery("tasks", broker="red Read More
