Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想接受带有参数的 GET 请求的 url。就像是:
/api/objects/[object_type]/?feature=1
如何配置 url 以接受此类内容?
视图开箱即用地支持这一点。要获取您可以执行的参数request.GET.get('feature'),在您的示例中将返回 1。
request.GET.get('feature')
尝试
url(r'^/api/objects/\/?feature=(?P<number>.*)...),