Re: Link to download a file

2017-09-07 Thread Andréas Kühne
= HttpResponse(data, mimetype='application/x-download') > resp['Content-Disposition'] = 'attachment; filename=dati.csv' > return resp > it works! > > > Il giorno giovedì 31 agosto 2017 17:58:27 UTC+2, giuseppe ricci ha scritto: > >> Hi guys, I n

Re: Link to download a file

2017-09-07 Thread giuseppe ricci
resp = HttpResponse(data, mimetype='application/x-download') resp['Content-Disposition'] = 'attachment; filename=dati.csv' return resp it works! Il giorno giovedì 31 agosto 2017 17:58:27 UTC+2, giuseppe ricci ha scritto: > > Hi guys, I need some help to insert a

Re: Link to download a file

2017-09-06 Thread James Schneider
On Wed, Sep 6, 2017 at 6:03 AM, giuseppe ricci wrote: > Thank you James for your reply.. > So in my urls.py I insert a new entry: > > url(r'^download/$', 'views.download') > > and my view to download a file is: > > def download(request): > file_path = 'static/tmp/' #settings.MEDIA_ROOT > return r

Re: Link to download a file

2017-09-06 Thread giuseppe ricci
a scritto: > > Hi guys, I need some help to insert a link to download a file. In a view I > read data from a csv file and I show them in a table in a template. Under > the table I need to insert, when there are data, > a link similar as Download data and when user click it, he do

Re: Link to download a file

2017-09-01 Thread James Schneider
On Aug 31, 2017 8:57 AM, "giuseppe ricci" wrote: Hi guys, I need some help to insert a link to download a file. In a view I read data from a csv file and I show them in a table in a template. Under the table I need to insert, when there are data, a link similar as Download data and

Link to download a file

2017-08-31 Thread giuseppe ricci
Hi guys, I need some help to insert a link to download a file. In a view I read data from a csv file and I show them in a table in a template. Under the table I need to insert, when there are data, a link similar as Download data and when user click it, he download the datafile, previously I