Reputation: 3459
I want a django url to look like this:
event/1?type=fun
so far I have:
url(r'^events/(?P<event_id>[\w\-]+)/(?P<event_code>[\w\-]+)/$', views.web_event)
which would be:
events/1/fun
what is the technique for changing it to parameters?
Upvotes: 2
Views: 116
Reputation: 25539
You are confused of GET
parameter with django url parameters. The parameter after ?
is an http request QueryString
that exists way before django does. You cannot control that with django url definition.
Django doc about GET and POST.
Edit:
As I stated above, it's a GET
parameter not a POST
parameter, so if you want to use it in your views, you should fetch it from request.GET
:
var = request.GET.get('q')
Upvotes: 6