Hi,

On 21 July 2010 21:40, Mike Orr <sluggos...@gmail.com> wrote:
> On Wed, Jul 21, 2010 at 12:33 PM, Ian Wilson <ianjosephwil...@gmail.com> 
> wrote:
>> Hello,
>>
>> I think you want something like this.
>>
>> from paste.fileapp import FileApp
>>
>> #.... in controller ....
>>         #...in some action, get the path to serve
>>         wsgi_app = FileApp(path)
>>         return wsgi_app(request.environ, self.start_response)
>
> Yes, use paste.fileapp.  You can just return the wsgi_app object
> directly, and Pylons will call it for you.
OK, this sounds exactly like what I need.

Thanks for the hint!

>> A better solution you might want to look into is x-sendfile/x-accel-redirect
>> which let's you pass the path up to a proxying server via a header that it
>> can use to serve the file.  That way you can check permissions in your app
>> but still serve the file via apache/nginx/etc.
>
> This is a more efficient method which some of us are starting to use.
This looks quite interesting, too, but I'm a bit concerned that I need
to do it in dev (using paster) differently to doing it on production
(apache/mod_wsgi). So, for the time being I'll probably stick with the
FileApp (if Pylons 0.9.6.2 supports it, I just hope - you know, legacy
pylons app ^^)

But, if how Wichert mentioned, paster.FileApp could be configured to
do that automatically (maybe with a switch in the ini file, and then
triggering some sort of middleware), that would be great, too!

Anyway, thanks for advice.

Jens

P.S. And I definitely know why I prefer the Pylons ML to the lists run
by other frameworks, namely some Java web frameworks.....Within
minutes, I got a correct, useful and concise answer. You guys are
really awesom!

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to