django url parameters

I want to accept a url for a GET request with parameters in it. Something like:

/api/objects/[object_type]/?feature=1

How do I configure the urls for accepting something like this?

Upvotes: 1

Views: 824

Answers (2)

Tamara
Tamara

Reputation: 75

try

 url(r'^/api/objects/\/?feature=(?P<number>.*)...),

Upvotes: 0

garnertb
garnertb

Reputation: 9584

Views support this out of the box. To get the parameters you can do request.GET.get('feature'), which would return 1 in your example.

Upvotes: 2

Related Questions