{"id":255907,"date":"2015-04-24T13:23:40","date_gmt":"2015-04-24T09:23:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255907"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255907","title":{"rendered":"\u041e\u0442 Python \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043e WSGI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f"},"content":{"rendered":"<p>     \t\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0431\u0443\u0434\u0435\u0442 Raspberry Pi. \u041b\u043e\u0433\u0438\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 python, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b python. \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c.<\/p>\n<ul>\n<li>1. lighttpd mod_cgi \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442<\/li>\n<li>2. web.py \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080<\/li>\n<li>3. WCGI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<li>4. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 WSGI<\/li>\n<li>5. WSGI \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c wsgiref<\/li>\n<li>6. WSGI c \u043f\u043e\u043c\u043e\u0449\u044c\u044e flup<\/li>\n<li>7. web.py \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c flup<\/li>\n<li>8. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a><br \/>  1. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u00ab\u0432 \u043b\u043e\u0431\u00bb \u0431\u044b\u043b \u043f\u043e\u0434\u043d\u044f\u0442 lighttpd c mod_cgi:<\/p>\n<pre><code class=\"bash\">sudo apt-get install lighttpd sudo nano \/etc\/lighttpd\/lighttpd.conf <\/code><\/pre>\n<p>  \u041e\u0442\u0440\u044b\u0432\u043e\u043a lighttpd.conf:<\/p>\n<pre><code class=\"tex\">#mod_cgi shoud be on server.modules = (     &quot;mod_access&quot;,     &quot;mod_alias&quot;,     &quot;mod_compress&quot;,     &quot;mod_redirect&quot;,     &quot;mod_cgi&quot;,     &quot;mod_rewrite&quot;, ) #rule enables cgi script cgi.assign = (&quot;.py&quot; =&gt; &quot;\/usr\/bin\/python&quot;) <\/code><\/pre>\n<p>  \/var\/www\/index.py:<\/p>\n<pre><code class=\"python\">print &quot;Content-Type: text\/html\\n\\n&quot; print &quot;Hello World!&quot; <\/code><\/pre>\n<p>  \u0442\u0435\u043f\u0435\u0440\u044c <a href=\"http:\/\/localhost\/index.py\">localhost\/index.py<\/a> \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u0431\u043e\u0434\u0440\u044b\u043c \u00abHello World!\u00bb<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 lighttpd \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .py \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 python-\u0443 \u0438 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 stdout. <br \/>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u00ab\u0441 \u043d\u0443\u043b\u044f\u00bb, \u0431\u044b\u043b \u0440\u043e\u0436\u0434\u0435\u043d <a href=\"https:\/\/github.com\/tarasii\/PythonHtmlGenerator\">HtmlGenerator<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u043e\u0434 html-\u0442\u0435\u0433\u0430\u043c\u0438, \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b, \u043d\u043e \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u043d\u0435 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u0435.<\/p>\n<p>  2. \u0420\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438. <br \/>  \u041f\u043e\u0434 \u0440\u0443\u043a\u0443 \u043f\u043e\u043f\u0430\u043b\u0441\u044f <a href=\"http:\/\/webpy.org\/\">wep.py<\/a>, \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0438 \u043c\u0430\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0439. <br \/>  code.py:<\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python # import web urls = ( '\/', 'index',)  class index:     def GET(self):         return &quot;Hello, world!&quot;  if __name__ == &quot;__main__&quot;:     web.application(urls, globals()).run() <\/code><\/pre>\n<p>  \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080 \u0432\u0438\u0441\u0438\u0442 \u043d\u0430\u0448\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<br \/>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0430\u043b\u0438\u0430\u0441 \u043d\u0430 \u043f\u043e\u0440\u0442 8080, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e. <br \/>  \u0414\u0430 \u043d\u043e \u043d\u0435\u0442, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u0441\u043b\u0430\u0431\u0435\u043d\u044c\u043a\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0447\u0442\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u0448\u0438\u043d\u043a\u0443 \u0438\u0437\u0440\u044f\u0434\u043d\u043e \u00ab\u0434\u0443\u0442\u044c\u0441\u044f\u00bb. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c lighttpd \u0441 mod_cgi.<\/p>\n<p>  \u041a\u0430\u043a \u0436\u0435 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>  3. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/WSGI\">WSGI<\/a>, \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430   <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python # def myapp(environ, start_response):     status = '200 OK'     response_headers = [('Content-type','text\/plain')]     start_response(status, response_headers)     return ['Hello World!\\n'] <\/code><\/pre>\n<p>  \u041d\u0438\u0447\u0435\u0433\u043e \u0432\u043e\u0435\u043d\u043d\u043e\u0433\u043e, \u043d\u043e \u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442. <br \/>  \u041c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043d\u0435\u044f\u0441\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0432\u0438\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u0447\u0442\u043e \u0436\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043d\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. <\/p>\n<p>  4. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 WSGI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0432 \u0440\u043e\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 WSGI:<br \/>  wsgi.py:  <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python import os import sys  def run_with_cgi(application):      environ = dict(os.environ.items())     environ['wsgi.input'] = sys.stdin     environ['wsgi.errors'] = sys.stderr     environ['wsgi.version'] = (1, 0)     environ['wsgi.multithread'] = False     environ['wsgi.multiprocess'] = True     environ['wsgi.run_once'] = True      if environ.get('HTTPS', 'off') in ('on', '1'):         environ['wsgi.url_scheme'] = 'https'     else:         environ['wsgi.url_scheme'] = 'http'      headers_set = []     headers_sent = []      def write(data):         if not headers_set:             raise AssertionError(&quot;write() before start_response()&quot;)          elif not headers_sent:             status, response_headers = headers_sent[:] = headers_set             sys.stdout.write('Status: %s\\r\\n' % status)             for header in response_headers:                 sys.stdout.write('%s: %s\\r\\n' % header)             sys.stdout.write('\\r\\n')          sys.stdout.write(data)         sys.stdout.flush()      def start_response(status, response_headers, exc_info=None):         if exc_info:             try:                 if headers_sent:                     raise exc_info[0], exc_info[1], exc_info[2]             finally:                 exc_info = None         elif headers_set:             raise AssertionError(&quot;Headers already set!&quot;)          headers_set[:] = [status, response_headers]         return write      result = application(environ, start_response)     try:         for data in result:             if data:                 write(data)         if not headers_sent:             write('')     finally:         if hasattr(result, 'close'):             result.close() <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 \u0443\u0436\u0435 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c lighttpd \u0438\u043b\u0438 apache, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost\/app.py\">localhost\/app.py<\/a><br \/>  \/var\/www\/app.py:  <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python include wsgi  def myapp(environ, start_response):     status = '200 OK'     response_headers = [('Content-type','text\/plain')]     start_response(status, response_headers)     return ['Hello World!\\n']  if __name__ == '__main__':     wsgi.run_with_cgi(myapp) <\/code><\/pre>\n<p>  5. \u0414\u043b\u044f python 2.7 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c wsgiref \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c WSGI \u0441\u0435\u0440\u0432\u0435\u0440  <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python import wsgiref.handlers  def myapp(environ, start_response):     status = '200 OK'     response_headers = [('Content-type','text\/plain')]     start_response(status, response_headers)     return ['Hello World!\\n']  if __name__ == '__main__':     wsgiref.handlers.CGIHandler().run(myapp) <\/code><\/pre>\n<p>  6. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f WSGI c \u043f\u043e\u043c\u043e\u0449\u044c\u044e flup:<br \/>  \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c flup  <\/p>\n<pre><code class=\"bash\">sudo apt-get install python-flup <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python import flup.server.fcgi  def myapp(environ, start_response):     status = '200 OK'     response_headers = [('Content-type','text\/plain')]     start_response(status, response_headers)     return ['Hello World!\\n']  if __name__ == '__main__':     flup.server.fcgi.WSGIServer(myapp).run() <\/code><\/pre>\n<p>  7. \u041f\u0440\u043e\u0441\u0442\u043e\u0435 web.py \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c flup:<br \/>  \/var\/www\/app.py:  <\/p>\n<pre><code class=\"python\">#! \/usr\/bin\/python import web urls = (  '\/', 'index', )  class index:     def GET(self):         return &quot;Hello World!&quot;  if __name__ == '__main__':     web.application(urls, globals()).run() <\/code><\/pre>\n<p>  \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost\/app.py\/\">localhost\/app.py<\/a><\/p>\n<p>  8. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e web.py \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 flup, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<br \/>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 web.py \u043d\u0430 wsgiref \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:  <\/p>\n<pre><code class=\"python\">web.application(urls, globals()).cgirun() <\/code><\/pre>\n<p>  B \u0441\u0441\u044b\u043b\u043a\u0430\u0445 \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u044b web.py \u0432 \u043a\u043e\u043d\u0446\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0432\u0438\u0442\u044c &#8216;\/&#8217; (app.py\/), \u0438\u043d\u0430\u0447\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u00abnot found\u00bb. \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c rewrite \u043f\u0440\u0430\u0432\u0438\u043b\u043e:  <\/p>\n<pre><code class=\"tex\"># mod_rewrite configuration. url.rewrite-once = (     &quot;^\/favicon.ico$&quot; =&gt; &quot;\/favicon.ico&quot;,      &quot;^\/(.*)$&quot; =&gt; &quot;app.py\/$1&quot; ,) <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"python\">import cgitb cgitb.enable() <\/code><\/pre>\n<p>  \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c:<br \/>  modwsgi<br \/>  paste<br \/>  pylons<\/p>\n<p>  \u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<br \/>  <a href=\"https:\/\/ru.wikipedia.org\/wiki\/WSGI\">WSGI wiki<\/a><br \/>  <a href=\"http:\/\/webpy.org\/\">wep.py<\/a><br \/>  <a href=\"http:\/\/hlabs.org\/development\/python\/wsgi.html\">WSGI \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0441\u0432\u044f\u0437\u0438 Web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 Python \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c<\/a><br \/>  <a href=\"http:\/\/citforum.ck.ua\/programming\/python\/wsgi\/\">WSGI, \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a><br \/>  <a href=\"http:\/\/henry.precheur.org\/python\/how_to_serve_cgi.html\">How to serve a WSGI application via CGI<\/a><br \/>  <a href=\"http:\/\/wsgi.readthedocs.org\/en\/latest\/#\">WSGI.org<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/67475\/\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python<\/a>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/256481\/\"> http:\/\/habrahabr.ru\/post\/256481\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0431\u0443\u0434\u0435\u0442 Raspberry Pi. \u041b\u043e\u0433\u0438\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 python, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b python. \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c.<\/p>\n<ul>\n<li>1. lighttpd mod_cgi \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442<\/li>\n<li>2. web.py \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080<\/li>\n<li>3. WCGI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<li>4. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 WSGI<\/li>\n<li>5. WSGI \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c wsgiref<\/li>\n<li>6. WSGI c \u043f\u043e\u043c\u043e\u0449\u044c\u044e flup<\/li>\n<li>7. web.py \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c flup<\/li>\n<li>8. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439<\/li>\n<\/ul>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-255907","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255907"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255907\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}