Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-31 Thread Stefano Probst
You could use a whole deployment setup. Forward Django though nginx by 
using WSGI (Gnuicorn, etc). Then everything should work.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5df18a18-7656-4741-bb8a-948db39b8bcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-30 Thread ali Eblice
thanks for reply
 i setup the x-sendfile but there's a problem :

django return a x-sendfile response successfully but since i'm using django 
development area and the development area runs on port 8000 the return 
response will be on port 8000 but the apache web server runs on port 80 so 
the response wont go to apache  so it cause me to download the file with 0 
byte size 

how can i solve this problem ?

On Friday, October 28, 2016 at 6:29:53 PM UTC+3:30, ali Eblice wrote:
>
> hello
> think of a downloading website:
> when we create a temporary link in django and map it to actual URL or file 
> path in database like this:
>
> id -- temporary_URL -- origin_URL  --  file_path
>
> so when a user used a temporary URL and directed to some view , how should 
> i return that file from that view for user to be able to download that file?
> i know that i can use "FileResponse"  or  "StreamingHttpResponse" but in 
> django documentation says that we should use these for short-lived requests 
> but downloading a big file can take long time, so what should i do ?
> i appreciate any help and idea 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d0fc69a-ca82-4b2f-81ce-82ba58afdf92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-29 Thread Stefano Probst

Hello,
you can use X-Accel-Redirect. See django-downloadview 
 
and "Nginx, Django, and X-Accel-Redirects". 


Best regards

Am Freitag, 28. Oktober 2016 16:59:53 UTC+2 schrieb ali Eblice:
>
> hello
> think of a downloading website:
> when we create a temporary link in django and map it to actual URL or file 
> path in database like this:
>
> id -- temporary_URL -- origin_URL  --  file_path
>
> so when a user used a temporary URL and directed to some view , how should 
> i return that file from that view for user to be able to download that file?
> i know that i can use "FileResponse"  or  "StreamingHttpResponse" but in 
> django documentation says that we should use these for short-lived requests 
> but downloading a big file can take long time, so what should i do ?
> i appreciate any help and idea 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4577820d-6643-400d-9746-62b46b394163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


question about returning file (pdf,image,zip...) in a request that made from temporary URL

2016-10-28 Thread ali Eblice
hello
think of a downloading website:
when we create a temporary link in django and map it to actual URL or file 
path in database like this:

id -- temporary_URL -- origin_URL  --  file_path

so when a user used a temporary URL and directed to some view , how should 
i return that file from that view for user to be able to download that file?
i know that i can use "FileResponse"  or  "StreamingHttpResponse" but in 
django documentation says that we should use these for short-lived requests 
but downloading a big file can take long time, so what should i do ?
i appreciate any help and idea 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/691d2358-77c7-49b3-bfe1-9b54c29262ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.