Re: how to serve static files with gevent ?

515 views
Skip to first unread message
Message has been deleted

Damjan

unread,
Dec 20, 2012, 10:30:46 PM12/20/12
to gevent: coroutine-based Python network library
> application = SharedDataMiddleware(application, {
>     '/hello/template/': os.path.join(os.getcwd(), 'template')})

This should work, if you:
1. *run* the script from a directory that has a 'template'
subdirectory
2. you request the url /hello/template/style.css for the file
os.getcwd()/'template'/style.css


SharedDataMiddleware will call the wrapped application if it doesn't
find a file, so that's what you see.

Rak

unread,
Jan 7, 2013, 11:24:16 AM1/7/13
to gev...@googlegroups.com
The SharedDataMiddleware is a method in werkzeug. This is not as efficient because SharedDataMiddleware somehow uses werkzeug server to serve the static files and werkzeug server is only for development and not meant for production. so My question was like does gevent itself has static file serving inbuilt . ? If so How can i use it ?

Sebastien Estienne

unread,
Feb 11, 2013, 7:24:17 PM2/11/13
to gev...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages