Sunday, August 5, 2012

django.shortcuts redirect doesn't pass argument

Hi all,

I'm trying to pass a filepath from one view to another by using 'redirect' from django.shortcuts, but the argument is not getting passed.  What am I doing wrong?

def upload1(request):
  if request.method == 'POST':
    form = UploadFileForm(request.POST, request.FILES)
    if form.is_valid():
      filepath = request.FILES['file']
      return redirect('/app/upload2/', filepath=filepath)

def upload2(request, filepath=None):
  if request.method == 'GET':
    if filepath:
    . . .

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Bl7QVZZv7_MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate