Hi Again I finally got it to work now.
return HttpResponseRedirect(reverse('bsapp:result', args=(question.id, xx,))) path('<int:question_id>/<str:xx>/result/', views.result, name='result'), (I think you mixed up the order of int:question here, you wrote question:int) xx="EXTRA ARGUMENT" def result(request, question_id, xx): Thanks for your help, I appreciate it very much. Peter Den tors 7 maj 2020 kl 14:06 skrev Andréas Kühne <andreas.ku...@hypercode.se >: > 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 a topic in the > Google Groups "Django users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/django-users/LUyl9dqbybE/unsubscribe. > To unsubscribe from this group and all its topics, 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 > <https://groups.google.com/d/msgid/django-users/CAK4qSCfNA1S3hTqkEJ%3DwwqoB3iSS6EOS%3Duhubu3m%2BprVaFbGmw%40mail.gmail.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/CAAkB%2BwmcyEJFSf4GQbB%2B7RE3o1Q6uHE0Tqm-WSPz0jM3XBStbw%40mail.gmail.com.