删除 django 中的 url 前缀

问题描述 投票:0回答:1

这是我的本地主机网址

localhost: 127.0.0.1:/8000/searches/?q=css
我想摆脱这些: '?q='

我尝试从我的 html 中删除名称属性。

<input type="text">

python html django attributes
1个回答
0
投票

让我们假设这是代码:

<input type="text" name="q" value="">

现在

Request.POST/GET['q']

将“q”作为您的值的变量,从而无需从您的网址中删除“q=”。

© www.soinside.com 2019 - 2024. All rights reserved.