Django form redirect using HttpResponseRedirect -
So it can not be very difficult but I can not understand it ... I To upload the file, I want my form in the dynamic (located at / file_upload / ), add it to the database, and then redirect to a new page where the parameter is the id of the field ( Is located in / file / 163 / ). I have set up the URLs so that / file / 163 / works fine if you navigate directly there, but I do not know / File / upload / My code is: def add (request): If request.method == 'POST': # If the form is submitted ... form = UploadFile Form (Request.POST, request.FILES) If Form Is_valid (): #DooStuff & amp; Add to database my_file = FileField.objects.create () Returns HttpResponseRedirect (reverse ('/ file /', args = [my_file.id])) I can not use it because I do not know that the field ID is going to happen until I manage the form in view.py, so the redirect should be in views.py. I guess Any thoughts? Your view should appear something like this: Def add (request...