提供静态文件。
fserve的Python项目详细描述
提供静态文件的简单有效的方法。用作雌蕊 示范。句柄sendifle api在您的系统上可用。
要求
- python 2.5或sup.
- gevent>;0.13
- 雌蕊>;=0.1.0
- http解析器=0.6.3
注意:要设置进程名,请安装库setprocttitle:
$ ps ax|grep test_cors 78064 s002 S+ 0:00.35 arbiter [test_cors running 3 workers] 78065 s002 S+ 0:00.10 worker test_cors [78065] 78066 s002 S+ 0:00.11 worker test_cors [78066] 78067 s002 S+ 0:00.09 worker test_cors [78067]
安装
执行以下命令之一从pypi安装它
pip install fserve
或:
easy_install fserve
来源:do:
$ git clone git://github.com/benoitc/fserve.git $ cd fserve && python setup.py install
用法
$ fserve [-h] [--bind BIND] [--workers WORKERS] [--debug] [path] serve a static file folder positional arguments: path Folder to serve optional arguments: -h, --help show this help message and exit --bind BIND The socket to bind. A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. An IP is a valid HOST. --name NAME name of the server --workers WORKERS Number of workers --debug Debug mode
示例:
在源文件夹中:
$ cd examples/static $ fserve --workers 3
继续http://127.0.0.1:5000url。