Redirect in Django is not working when files are uploaded using Dropzone.js
, so I used windows.href
in the Dropzone success
event but I have to pass a parameter.
views.py:
if request.method == 'POST' and request.FILES['files']:
...
if form.is_valid():
....
user = User.objects.get(email=email)
id = user.id
return redirect(reverse('success', kwargs={'id': id})) <<-- not working
JQuery - Dropzone:
this.on('success', function() {
window.location.href = '/success/';
})
I don't reckon there is a way to pass the id
to JQuery in this case, so I have to use redirect in Django. How can it get done?