Python Django`request.query_params.get(";page";)`返回无?

Python Django`request.query_params.get(";page";)`返回无?,python,django,redux,next.js,query-parameters,Python,Django,Redux,Next.js,Query Parameters,当我在搜索框中键入用户并提交时,我就是这样设置url的: const submitHandler=(事件:FormEvent)=>{ event.preventDefault(); 如果(关键字){ push({路径名:,查询:{关键字:关键字,页面:1}}); }否则{ Router.push(Router.Router?.asPath作为字符串); } }; 这是它在url上的外观:”http://localhost:4500/?keyword=ca&page=1" 我使用Next.js作

当我在搜索框中键入用户并提交时,我就是这样设置url的:

const submitHandler=(事件:FormEvent)=>{
event.preventDefault();
如果(关键字){
push({路径名:,查询:{关键字:关键字,页面:1}});
}否则{
Router.push(Router.Router?.asPath作为字符串);
}
};
这是它在url上的外观:”http://localhost:4500/?keyword=ca&page=1"

我使用Next.js作为前端,这就是我发送查询参数的方式

导出常量getServerSideProps=wrapper.getServerSideProps( 异步(上下文)=>{ const{store,query}=context; console.log(“参数”,查询); store.dispatch(fetchproductssstart(query)); 存储调度(结束); 等待(存储为SagaStore).sagaTask.toPromise(); const state=store.getState(); const productListState=state.productList?state.productList:空; 返回{props:{productListState}}; } );
console.log(“params”,query)
返回此对象:“{keyword:'g',page:'1'}”。这是我发送到后端的内容。 这里是“fetchProductsStart”

export const fetchproductssstart=(
查询参数:{关键字:字符串,页面:字符串}
):actions.IFetchProductsStart=>({
类型:ProductListActionTypes.PRODUCT\u LIST\u START,
有效载荷:queryParams,
});
这就是我试图在后端获取参数的方式:

@api_视图(['GET']))
def getProducts(请求):
q=request.query_params.get(“页面”)
打印(“页面查询参数”,q)
query=request.query\u参数
打印(“查询参数”,查询)
打印(“页面查询参数”,q)
返回“无”

打印(“查询参数”,查询)
返回“”

问题到目前为止,我正在发送一个对象。相反,我把它严格化了”

现在在后端

query = request.query_params
print("query",query)
它打印:
query


但是
request.query\u params.get(“关键字”)
仍然不起作用。它不返回任何值尝试像这样获取请求参数
request.get.get('param\u name')
问题在于我如何将查询参数传递到后端:

而不是这个
store.dispatch(fetchProductsStart(JSON.stringify(query))


您可以共享fetchProductsStart函数吗?您确定“query”的内容是作为查询参数发送的吗?
q=request.query\u params.get(“page”)
/?page=
中查找页面,请求url中似乎没有参数
page
。@这是浏览器上的url:“do
request.get.get”(“page”)
@acw它返回以下内容:(“[对象]”,“”)
query = request.query_params
print("query",query)
store.dispatch(
  fetchProductsStart(`keyword=${query["keyword"]}&page=${query["page"]}`)
);