I want to make a response that both redirect to certain url and donwload a file. To download a file I use:
content = "Example content"
filename = "example-file-name".
response = HttpResponse(content=content,
content_type='text/plain')
response['Content-Disposition'] = 'attachment; filename={0}'.format(filename)
return response
To redirect to url:
response = HttpResponseRedirect(redirect_to=example_url)
Is there a way to make both things in a single response?