Hi Peter, The thing is you need to handle this with your url files, your view function (or class) and your reverse call.
So for example: urls.py path('blog/<category:str>/<question_id:int>/', detail) views.py: def detail(request, category, question_id): and finally the call to reverse: reverse('polls:results', args=(category.slug, question.id, )) Something like that. All of this is connected - so you need to do all of it. However if you only want to get a url parameter, you can do so via the request object: For example: blog/category_slug/23/?shoe_size=42 to get the shoe_sizer you get it in the view: def detail(request, category, question_id): shoe_size = request.GET.get('shoe_size') Hope this helps! Regards, Andréas Den tors 7 maj 2020 kl 12:39 skrev Ekberg Peter <npc.ekb...@gmail.com>: > I know something like this has been asked before but I never seen any > answer that I can understand or that works. But I am very new on Django so > maybe I could have missed it. But there must be an easy answer to my > question. I am following the tutorial for Django and at section 4 they use > the httpresponseredirect to go to next page after posting a form. > > > return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) > > The views page function looks like this: > > > def detail(request, question_id): > > My question is: How can I send more arguments than the question.id to the > function? > > Thx > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/5be13b82-36e5-4939-a822-a0b56b6dee66%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/5be13b82-36e5-4939-a822-a0b56b6dee66%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCfNA1S3hTqkEJ%3DwwqoB3iSS6EOS%3Duhubu3m%2BprVaFbGmw%40mail.gmail.com.