nt-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 link to download a file. In a view
>> I read data from
-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 link to download a file. In a view I
> read data from a csv file and I
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/'
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 wrote the
On Aug 31, 2017 8:57 AM, "giuseppe ricci" <peppepega...@gmail.com> 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
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
That's an interesting project!
If I use WhiteNoise as part of a production deploy somewhere, can I skip
(or ignore) running 'manage.py collectstatic' ?
Yours,
Abraham V.
On Wednesday, 3 May 2017 15:13:36 UTC-4, Dan Tagg wrote:
>
> You might want to check out WhiteNoise (
>
You might want to check out WhiteNoise (
https://whitenoise.readthedocs.io/en/stable/) perhaps in conjunction with a
CDN
On 3 May 2017 at 19:35, Tim Chase wrote:
> On 2017-05-02 19:11, Antonis Christofides wrote:
> > response = HttpResponse(csvfile.read(),
On 2017-05-02 19:11, Antonis Christofides wrote:
> response = HttpResponse(csvfile.read(), content_type='text/csv')
Beware that, if your content can get huge (some of our reports can
run to hundreds of megabytes), you might want to investigate
something like the "sendfile" alternatives or spew it
It's work with the use of media :)
Thanks for the help !
Le mardi 2 mai 2017 18:13:01 UTC+2, Antonis Christofides a écrit :
>
> You cannot get a file outside of your project unless you symlink it inside
> the project. This is also a Very Bad Thing(TM) as it may allow attackers to
> request
> You cannot get a file outside of your project unless you symlink it inside the
> project. This is also a Very Bad Thing(TM) as it may allow attackers to
> request arbitrary files.
You /can/ get a file outside your project. Whether this is a bad thing or not
depends on why and how. I also don't
You cannot get a file outside of your project unless you symlink it inside the
project. This is also a Very Bad Thing(TM) as it may allow attackers to request
arbitrary files.
What you should do instead is this:
1) Put Data/01/export.txt to the static/ folder inside your app (with the same
This is in development. I try to send url of my file in views.py :
return render(request, "export.html", {'out': urlOut})
and in my template I have the link :
Lien du fichier
but when I open it I have this link :
http://127.0.0.1:8000/home/myuser/Data/01/export.txt
and I want to
Is this in production or development? What is the url that doesn't work? What
happens when you try the url?
Regards,
A.
Antonis Christofides
http://djangodeployment.com
On 2017-05-02 11:28, Sixtine Vernhes wrote:
> Hi !
>
> I try to create a link on Django who download a static csv file, but I
Hi !
I try to create a link on Django who download a static csv file, but I have
no idea how to do.
In my settings.py :
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static/"),
)
and my file is in this directory
Would anyone have an idea ?
--
You received
15 matches
Mail list logo