搭建 Nginx+FastCGI+Webpy 平台开发Python Web应用

web.py is a web framework for Python that is as simple as it is powerful. web.py is in the public domain; you can use it for whatever purpose with absolutely no restrictions.

webpy相比于django很轻量很容易上手。

需要用到easy_install,flup。假设已经装好了NGINX。
安装web.py:
easy_install web.py

配置NGINX(如果需要访问静态文件别忘了自己再单独配一下):
server {
        listen       80;
        server_name  webpy.com;

        root   /home/admin/python/webpy;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        location ~* / {
                fastcgi_pass 127.0.0.1:9002;
                fastcgi_pass_header Authorization;
                fastcgi_intercept_errors off;
                fastcgi_param PATH_INFO         $fastcgi_script_name;
                fastcgi_param REQUEST_METHOD    $request_method;
                fastcgi_param QUERY_STRING      $query_string;
                fastcgi_param CONTENT_TYPE      $content_type;
                fastcgi_param CONTENT_LENGTH    $content_length;
                fastcgi_param SERVER_PORT       $server_port;
      

相关推荐