Passing a GET parameter through the view in Django

1

I'm trying to pass a parameter via GET on the URL through the Django backend, but I'm not getting it.

My url for the page I want to pass the parameter to is

url(r'^(?P<short_name>\w+)/schedule/$', schedule_views.schedule, name='schedule'),

And I wanted it, right after I did things in the call view, it rendered the page with the link schedule /? date = 2018-03-01, for example.

I know I can get the GET through the request.GET.get, however I would like to pass this parameter back to the front end.

Thank you!

    
asked by anonymous 01.03.2018 / 14:04

1 answer

0

I think the solution would be for you to do the redirect already with the query string, something like:

from django.shortcuts import redirect

def schedule(request):

    # varios codigos

    return redirect(reverse('search_view') + '?date=2018-03-01')
    
03.03.2018 / 01:50