[Answered ]-Send form informations between pages in DJANGO

1👍

This might be helpful.

After validating and saving form:

if form.is_valid():
    form.save()

you can redirect the user to another path with GET parameters like this:

return redirect(reverse('view_02_name_in_urlconf', kwargs={"key": your_calculation}))

So, you can do like this:

if form.is_valid():
    form.save()
    
    # do some calculations with form over here

    return redirect(reverse('view_02_name', kwargs={"key": your_calculation}))

Url configuration for view_02 must look like this:

url(r'^/(?P<key>[0-9]+)/$', views_02.view_02_name_in_view.py, name='view_02_name')

View and its functions can be named after any string you like.

Then you can show the calculated data in view_02. Or you can reverse with raw data and do calculations in view_02.

Thanks for reading.

Leave a comment