I am returning a pdf file to be downloaded. On success I'd like the success message to be flashed. I want the user to stay at the same page. Ajax wouldn't work as it is file download.
but it seems that the flash messages work only with HttpResponseRedirect objects - and file download does not work with it? anyway, something like that flashes the message but does not download the file:
response = HttpResponseRedirect(content=attachment, content_type='application/pdf', redirect_to='/app/')
on the contrary, HttpResponse seems to be able to download the file, but the messages don't get flashed.
I'd be grateful for tips :) Python 3.5, Django 1.10