查询是通过get的方式,之前没有分页之前,url是这样的:
http://hostname/search?query=port%3A8080
那么我的想法是如果分页了。
1,不带page参数了。next之后就加载下一页的内容
http://hostname/search?query=port%3A8080
请问这个是通过post传参吗?
2,
使用官方文档中的(目前的方案)
http://hostname/search?query=port%3A8080?page=2
但是,在现实情况下。?page=2 就替代了?query=port%3A8080 变成了这样:
http://hostname/search?page=2
请问这这种情况怎么处理?
urls.py
url(r'^search$', views.show_results, name='results'),
谢谢
Sorry, I didn’t quite understand the question...
"1, without the page parameter. After next, the content of the next page will be loaded."
Doesn’t page mean which page of data is to be queried? For example, you have opened page 1 now, click next, and request the parameter page=2 from the backend. So, this page is a must-have. Otherwise, how does the backend know which page the next page is?
In addition, if there are multiple parameters, then multiple parameter pairs need to be connected with & instead of? . Only the first parameter is in front? Connect with URL. Is there a "clerical error" in the URL in your question?
Backend url matching is based on regular matching,? The latter part will be ignored when matching the URL.