{"id":1021,"date":"2008-08-30T15:00:00","date_gmt":"2008-08-30T15:00:00","guid":{"rendered":"https:\/\/rawbytes.org\/?p=1021"},"modified":"2025-11-24T02:59:30","modified_gmt":"2025-11-24T02:59:30","slug":"wsgi%e3%81%93%e3%81%a8%e3%81%af%e3%81%98%e3%82%81","status":"publish","type":"post","link":"https:\/\/rawbytes.org\/?p=1021","title":{"rendered":"WSGI\u3053\u3068\u306f\u3058\u3081"},"content":{"rendered":"<blockquote><p>WSGI (Web Server Gateway Interface) \u306f Django \u3084 Google App Engine \u3092\u59cb\u3081\u305f\u304f\u3055\u3093\u306e Python Web \u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u6e96\u62e0\u3057\u3066\u3044\u308b\u4ed5\u69d8\u3067\u3001\u3053\u308c\u306b\u3064\u3044\u3066\u306e\u79c0\u9038\u306a\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u7ffb\u8a33\u3002\u65e5\u672c\u8a9e\u8a33\u304c\u79c0\u9038\u304b\u3069\u3046\u304b\u306f\u77e5\u3089\u306a\u3044\u306e\u3067\u3001\u602a\u3057\u3044\u90e8\u5206\u306f\u539f\u6587\u306b\u3042\u305f\u3063\u3066\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p><\/blockquote>\n<p>WSGI \u3053\u3068\u306f\u3058\u3081<br \/>\n====================<br \/>\n\u8457\u8005(Author): Armin Ronacher<br \/>\n\u539f\u6587(Original Text): http:\/\/lucumr.pocoo.org\/articles\/getting-started-with-wsgi<br \/>\n\u7ffb\u8a33(Japanese Translation): hkurosawa<br \/>\n\u30e9\u30a4\u30bb\u30f3\u30b9(Lisence): http:\/\/creativecommons.org\/licenses\/by-nc-sa\/2.0\/at\/deed.ja<br \/>\n====================<\/p>\n<p>\u3084\u3063\u3068\u8ad6\u6587\u3082\u7d42\u308f\u3063\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u8a18\u4e8b\u3092\u66f8\u304f\u305f\u3081\u306e\u6642\u9593\u304c\u3067\u304d\u305f\u3002<br \/>\n\u305a\u3063\u3068\u66f8\u304d\u305f\u304b\u3063\u305f\u3082\u306e\u306e\u4e00\u3064\u304c\u3001\u7279\u5b9a\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084\u5b9f\u88c5\u3092<br \/>\n\u5fc5\u8981\u3068\u3057\u306a\u3044 WSGI \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306a\u3093\u3060\u3002\u3055\u3042\u59cb\u3081\u3088\u3046\u3002<\/p>\n<p><img decoding=\"async\" alt=\"wsgi-snake.png\" src=\"http:\/\/dmsolutions.jp\/wp\/wp-content\/uploads\/2008\/08\/wsgi-snake.png\" \/><\/p>\n<p><strong>* WSGI \u3063\u3066\u306a\u3093\u3060\uff1f<\/strong><br \/>\n\u57fa\u672c\u7684\u306b\u3001WSGI \u306f\u305f\u3076\u3093\u30ad\u30df\u306e\u3057\u3063\u3066\u308b CGI \u3088\u308a\u3082\u4f4e\u5c64\u306e\u3082\u306e\u3060\u3002<br \/>\n\u3060\u3051\u3069 CGI \u3068\u9055\u3046\u306e\u306f\u3001WSGI \u306f\u30b9\u30b1\u30fc\u30eb\u3059\u308b\u3057\u3001\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3067\u3082<br \/>\n\u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u74b0\u5883\u3067\u3082\u52d5\u4f5c\u3059\u308b\u3001\u306a\u305c\u3063\u3066\u3001\u3053\u308c\u306f\u3069\u3046\u5b9f\u88c5\u3055\u308c\u308b\u304b\u306f<br \/>\n\u305c\u3093\u305c\u3093\u6c17\u306b\u3057\u3066\u306a\u3044\u4ed5\u69d8\u3060\u304b\u3089\u3060\u3002\u4e8b\u5b9f\u3001 WSGI \u306f Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068<br \/>\n\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e CGI\u3001mod_python\u3001FastCGI \u307e\u305f\u306f wsgiref \u3068\u547c\u3070\u308c\u308b<br \/>\n\u30b3\u30a2\u306b WSGI \u3092\u7d44\u307f\u8fbc\u3093\u3060 Python \u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u30b5\u30fc\u30d0<br \/>\n\u307f\u305f\u3044\u306a\u5c64\u306e\u9593\u306b\u4f4d\u7f6e\u3057\u3066\u3001\u3060\u304b\u3089 CGI \u3068\u306f\u7570\u306a\u308b\u3002<\/p>\n<p>WSGI \u306f PEP 333 \u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u3066\u3001\u6709\u540d\u306a django \u3084 pylons \u3092\u542b\u3080<br \/>\n\u69d8\u3005\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u9069\u7528\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u30ad\u30df\u304c\u30b5\u30dc\u3063\u3066 pep 333 \u3092\u8aad\u307e\u306a\u3044\u306a\u3089\u3001\u8981\u7d04\u306f\u3053\u308c\u3060\uff1a<br \/>\n\u30fbWSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u547c\u3073\u51fa\u3057\u53ef\u80fd\u306a Python \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u95a2\u6570\u304b\u30012\u3064\u306e\u5f15\u6570\u3092\u53d6\u308b __call__ \u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3064\u30af\u30e9\u30b9\uff1a1 \u3064\u304c WSGI \u74b0\u5883\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u958b\u59cb\u3059\u308b\u95a2\u6570\uff09\u3002<br \/>\n\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u4e0e\u3048\u3089\u308c\u305f\u95a2\u6570\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u958b\u59cb\u3057\u3066\u3001\u6e21\u3055\u308c\u308b\u9805\u76ee\u304c\u66f8\u304d\u51fa\u3057\u3068\u30d5\u30e9\u30c3\u30b7\u30e5\u3092\u610f\u56f3\u3059\u308b\u30a4\u30c6\u30ec\u30fc\u30bf(iterable) \u3092\u8fd4\u3055\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\n\u30fbWSGI \u74b0\u5883\u306f CGI \u74b0\u5883\u307f\u305f\u3044\u306a\u3082\u306e\u3067\u3001\u30b5\u30fc\u30d0\u3084\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304b\u3089\u3044\u304f\u3064\u304b\u306e\u30ad\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3082\u306e\u3060\u3002<br \/>\n\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30e9\u30c3\u30d7\u3059\u308b\u3053\u3068\u3067\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u8ffd\u52a0\u3067\u304d\u308b\u3002<\/p>\n<p>\u305f\u304f\u3055\u3093\u60c5\u5831\u304c\u3042\u308b\u304b\u3089\u3068\u308a\u3042\u3048\u305a\u306f\u7121\u8996\u3057\u3066\u3001\u57fa\u672c\u7684\u306a WSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u898b\u3066\u3044\u3053\u3046\uff1a<\/p>\n<p>\n<strong>* \u62e1\u5f35\u7248 Hello World<\/strong><br \/>\n\u3053\u308c\u306f\u5358\u7d14\u3060\u3051\u3069\u5358\u7d14\u3059\u304e\u308b\u3063\u3066\u3053\u3068\u306f\u306a\u3044 WSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f8b\u3067\u3001<br \/>\nHello World! \u306e World \u3092 url \u30d1\u30e9\u30e1\u30bf\u3067\u6307\u5b9a\u3057\u3066\u51fa\u529b\u3067\u304d\u308b\u3002<\/p>\n<p><code><\/code><\/p>\n<pre><code>from cgi import parse_qs, escape\n\ndef hello_world(environ, start_response):\n    parameters = parse_qs(environ.get('QUERY_STRING', ''))\n    if 'subject' in parameters:\n        subject = escape(parameters['subject'][0])\n    else:\n        subject = 'World'\n    start_response('200 OK', [('Content-Type', 'text\/html')])\n    return ['''<title>Hello %(subject)s<\/title>\n    Hello %(subject)s!\n''' % {'subject': subject}]\n<\/code><\/pre>\n<p>\u898b\u308b\u3068\u5206\u304b\u308b\u3051\u3069\u3001 start_response \u95a2\u6570\u306f 2 \u3064\u306e\u5f15\u6570\u3092\u53d6\u3063\u3066\u3044\u308b\u3002<br \/>\n\u30b9\u30c6\u30fc\u30bf\u30b9\u6587\u5b57\u5217\u3068\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u3092\u8868\u3059\u30bf\u30d7\u30eb\u306e\u30ea\u30b9\u30c8\u3060\u3002<br \/>\n\u3053\u3053\u3067\u3082\u3069\u3053\u3067\u3082\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u304b\u3089\u5206\u304b\u3089\u306a\u3044\u3093\u3060\u3051\u3069\u3001 start_response \u95a2\u6570\u306f<br \/>\n\u3042\u308b\u7269\u3092\u8fd4\u3059\u3002\u3053\u308c\u306f write \u95a2\u6570\u3092\u8fd4\u3057\u3066\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e\u51fa\u529b\u30b9\u30c8\u30ea\u30fc\u30e0\u306b<br \/>\n\u76f4\u63a5\u66f8\u304d\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3060\u3002\u3053\u308c\u306f\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\uff08\u3053\u308c\u306f\u5f8c\u3067\u89e6\u308c\u308b\u306d\uff09\u3092<br \/>\n\u8fc2\u56de\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u3053\u306e\u95a2\u6570\u3092\u4f7f\u3046\u306e\u306f\u975e\u9053\u3044\u30a2\u30a4\u30c7\u30a2\u3060\u3051\u3069\u3001<br \/>\n\u30c7\u30d0\u30c3\u30b0\u76ee\u7684\u3067\u306a\u3089\u4fbf\u5229\u306b\u4f7f\u3048\u308b\u3002<\/p>\n<p>\u3060\u3051\u3069\u3001\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3069\u3046\u3084\u3063\u3066\u958b\u59cb\u3059\u308b\uff1f<br \/>\n\u8ab0\u3082\u3053\u306e\u95a2\u6570\u3092\u547c\u3093\u3067\u306a\u3044\u3093\u3060\u304b\u3089\u3001\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306f\u304a\u308d\u304b<br \/>\nPython \u3060\u3063\u3066\u3053\u308c\u3092\u3069\u3046\u6271\u3063\u3066\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u3044\u3002<br \/>\n\u9762\u5012\u3060\u304b\u3089\u3053\u3053\u3067\u306f WSGI \u3092\u30b5\u30dd\u30fc\u30c8\u3057\u305f\u30b5\u30fc\u30d0\u306e\u8a2d\u5b9a\u306a\u3093\u304b\u3057\u305f\u304f\u306a\u3044\u3051\u3069\u3001<br \/>\nPython 2.5 \u4ee5\u964d\u306b\u30d0\u30f3\u30c9\u30eb\u3055\u308c\u3066\u3044\u308b wsgiref \u3068\u3044\u3046WSGI \u306e<br \/>\n\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u30b5\u30fc\u30d0\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n\uff08Python 2.3 \u304b 2.4 \u7528\u306a\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3082\u3067\u304d\u308b\u3088\uff09<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306b\u3053\u308c\u3092\u8ffd\u52a0\u3057\u3066\u307f\u3066\uff1a<\/p>\n<p><code><\/code><\/p>\n<pre><code>if __name__ == '__main__':\n    from wsgiref.simple_server import make_server\n    srv = make_server('localhost', 8080, hello_world)\n    srv.serve_forever()\n<\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\u3068 http:\/\/localhost:8080\/?subject=John \u3067\u306f<br \/>\nHello John! \u3066\u51fa\u3066\u304f\u308b\u306f\u305a\u3060\u3002<\/p>\n<p>\n<strong>* \u30d1\u30b9\u306e\u30c7\u30a3\u30b9\u30d1\u30c3\u30c1<\/strong><br \/>\n\u30ad\u30df\u306f\u3001\u305f\u3076\u3093 CGI \u3068\u304b PHP \u306a\u3089\u4f7f\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u3088\u306d\u3002\u306a\u3089\u3070\u3001<br \/>\n\u5927\u62b5\u306f\u30e6\u30fc\u30b6\u304c\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u8907\u6570\u306e\u30d1\u30d6\u30ea\u30c3\u30af\u306a\u30d5\u30a1\u30a4\u30eb(.pl\/.php) \u304c<br \/>\n\u3042\u3063\u3066\u3001\u305d\u308c\u3089\u3067\u4f55\u304b\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u77e5\u3063\u3066\u308b\u3002WSGI \u3067\u306f\u305d\u3046\u3058\u3083\u306a\u3044\u3002<br \/>\n\u5168\u3066\u306e\u30d1\u30b9\u3092\u51e6\u7406\u3059\u308b\u305f\u3060\u4e00\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u3060\u3051\u3060\u3002\u3060\u304b\u3089\u3001<br \/>\n\u3055\u3063\u304d\u306e\u4f8b\u306e\u30b5\u30fc\u30d0\u304c\u307e\u3060\u52d5\u3044\u3066\u3044\u308b\u306a\u3089\u3001\u540c\u3058\u30b3\u30f3\u30c6\u30f3\u30c4\u3092<br \/>\nhttp:\/\/localhost:8080\/foo?subject=John \u304b\u3089\u3067\u3082\u898b\u3089\u308c\u308b\u3002<\/p>\n<p>\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u30d1\u30b9\u306f WSGI \u74b0\u5883\u306e PATH_INFO \u5909\u6570\u306b\u3001<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u969b\u306e\u30d1\u30b9\u306f SCRIPT_NAME \u306b\u4fdd\u5b58\u3055\u308c\u308b\u3002<br \/>\n\u958b\u767a\u30b5\u30fc\u30d0\u306e\u5834\u5408\u306f SCRIPT_NAME \u306f\u7a7a\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u3001<br \/>\nhttp:\/\/example.com\/wiki \u306b wiki \u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308c\u3070 <br \/>\nSCRIPT_NAME \u5909\u6570\u306f \/wiki \u306b\u306a\u308b\u3060\u308d\u3046\u3002\u3053\u306e\u60c5\u5831\u3067\u3001\u5e7e\u3064\u3082\u306e<br \/>\n\u72ec\u7acb\u3057\u305f\u30da\u30fc\u30b8\u3092\u30b9\u30c6\u30ad\u306a URL \u3067\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u305f\u304f\u3055\u3093\u306e\u6b63\u898f\u8868\u73fe\u304c\u3042\u3063\u3066\u3001\u73fe\u5728\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u30de\u30c3\u30c1\u3055\u305b\u3066\u3044\u308b\uff1a<\/p>\n<p><code><\/code><\/p>\n<pre><code>import re\nfrom cgi import escape\n\ndef index(environ, start_response):\n    \"\"\"\u3053\u306e\u95a2\u6570\u306f \"\/\" \u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3001hello world \u306e\u30da\u30fc\u30b8\n    \u3078\u306e\u30ea\u30f3\u30af\u3092\u8868\u793a\u3059\u308b\u3002\"\"\"\n    start_response('200 OK', [('Content-Type', 'text\/html')])\n    return ['''<title>Hello World Application<\/title>\n               This is the Hello World application:\n<a href=\"http:\/\/www.blogger.com\/hello\/\">continue<\/a>\n''']\n\ndef hello(environ, start_response):\n    \"\"\"\u4e0a\u306e\u4f8b\u3068\u540c\u69d8\u3060\u3051\u3069\u3001URL \u3067\u6307\u5b9a\u3057\u305f\u540d\u524d\u3092\u4f7f\u3046\u3002\"\"\"\n    # \u5b58\u5728\u3059\u308c\u3070\u3001url \u304b\u3089\u540d\u524d\u3092\u53d6\u5f97\u3059\u308b\u3002\n    args = environ['myapp.url_args']\n    if args:\n        subject = escape(args[0])\n    else:\n        subject = 'World'\n    start_response('200 OK', [('Content-Type', 'text\/html')])\n    return ['''<title>Hello %(subject)s<\/title>\n            Hello %(subject)s!\n''' % {'subject': subject}]\n\ndef not_found(environ, start_response):\n    \"\"\"URL \u304c\u4f55\u3082\u30de\u30c3\u30c1\u3057\u306a\u3044\u3068\u304d\u306b\u547c\u3070\u308c\u308b\u3002\"\"\"\n    start_response('404 NOT FOUND', [('Content-Type', 'text\/plain')])\n    return ['Not Found']\n\n# URL \u3092\u95a2\u6570\u306b\u5272\u308a\u5f53\u3066\u308b\u3002\nurls = [\n    (r'^$', index),\n    (r'hello\/?$', hello),\n    (r'hello\/(.+)$', hello)\n]\n\ndef application(environ, start_response):\n    \"\"\"\n    WSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e1\u30a4\u30f3\u3002\u4e0a\u304b\u3089\u9806\u756a\u306b\u73fe\u5728\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\n    \u95a2\u6570\u306b\u30c7\u30a3\u30b9\u30d1\u30c3\u30c1\u3057\u3066\u304b\u3089\u305d\u306e\u6b63\u898f\u8868\u73fe\u306f 'myapp.url_args' \u3068\u3057\u3066\n    WSGI \u74b0\u5883\u306b\u4fdd\u5b58\u3057\u3066\u3001\u4e0a\u306e\u95a2\u6570\u304c\u3053\u306e url \u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306b\n    \u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002\n    \u4f55\u3082\u30de\u30c3\u30c1\u3057\u306a\u3051\u308c\u3070\u3001'not_found' \u95a2\u6570\u304c\u547c\u3070\u308c\u308b\u3002\n    \"\"\"\n    path = environ.get('PATH_INFO', '').lstrip('\/')\n    for regex, callback in urls:\n        match = re.search(regex, path)\n        if match is not None:\n            environ['myapp.url_args'] = match.groups()\n            return callback(environ, start_response)\n    return not_found(environ, start_response)\n<\/code><\/pre>\n<p>\u3051\u3063\u3053\u3046\u3042\u308b\u306d\u3002\u3060\u3051\u3069 URL \u30c7\u30a3\u30b9\u30d1\u30c3\u30c1\u304c\u3069\u3046\u52d5\u304f\u304b\u5206\u304b\u308b\u3068\u601d\u3046\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u3001http:\/\/localhost:8080\/hello\/John \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068<br \/>\n\u3088\u308a\u30ab\u30c3\u30b3\u3044\u3044 URL \u3067\u4e0a\u3068\u540c\u3058\u7d50\u679c\u306b\u306a\u3063\u3066\u3001\u9593\u9055\u3063\u305f URL \u3092\u5165\u529b\u3059\u308b\u3068<br \/>\n404 \u30a8\u30e9\u30fc\u306e\u30da\u30fc\u30b8\u306b\u306a\u308b\u3002\u4eca\u5ea6\u306f\u3053\u308c\u3092\u305a\u3063\u3068\u6539\u5584\u3057\u3066\u3001<br \/>\nenviron \u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30ab\u30d7\u30bb\u30eb\u5316\u3068\u3001<br \/>\nstart_response \u547c\u3073\u51fa\u3057\u3068\u8fd4\u3059\u30a4\u30c6\u30ec\u30fc\u30bf\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e<br \/>\n\u7f6e\u304d\u66ff\u3048\u3092\u3057\u3066\u307f\u3088\u3046\u3002\u3053\u308c\u306f werkzeug \u3084 paste \u307f\u305f\u3044\u306a <br \/>\nWSGI \u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u3057\u3066\u3044\u308b\u3053\u3068\u3060\u3002<\/p>\n<p>\u74b0\u5883\u306b\u4f55\u304b\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u50d5\u305f\u3061\u306f\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304c\u901a\u5e38\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n\u3060\u304b\u3089\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3057\u3066\u3001\u305d\u308c\u3092\u30d6\u30e9\u30a6\u30b6\u306b\u66f8\u304d\u51fa\u3059\u3082\u306e\u3092\u66f8\u3044\u3066\u307f\u3088\u3046\u3002<\/p>\n<p><code><\/code><\/p>\n<pre><code># \u30c8\u30ec\u30fc\u30b9\u30d0\u30c3\u30af\u306e\u53d6\u5f97\u3068\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u30d8\u30eb\u30d1\u30fc\u95a2\u6570\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\nfrom sys import exc_info\nfrom traceback import format_tb\n\nclass ExceptionMiddleware(object):\n    \"\"\"\u4f7f\u7528\u3059\u308b\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\"\"\"\n\n    def __init__(self, app):\n        self.app = app\n\n    def __call__(self, environ, start_response):\n        \"\"\"\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3067\u304d\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u547c\u3073\u51fa\u3057\"\"\"\n        appiter = None\n        # \u5358\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3059\u308b\u4ee5\u5916\u306f\n        # \u51fa\u529b\u3092\u5909\u66f4\u3057\u306a\u3044\u3067\u623b\u3059\n        try:\n            appiter = self.app(environ, start_response)\n            for item in appiter:\n                yield item\n        # \u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u4f8b\u5916\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3067\u304d\u308b\n        # \u30c8\u30ec\u30fc\u30b9\u30d0\u30c3\u30af\u306e\u6e96\u5099\u3092\u3059\u308b\n        except:\n            e_type, e_value, tb = exc_info()\n            traceback = ['Traceback (most recent call last):']\n            traceback += format_tb(tb)\n            traceback.append('%s: %s' % (e_type.__name__, e_value))\n            # \u3053\u3053\u307e\u3067\u3067\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u5ba3\u8a00\u3057\u3066\u3044\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002\n            # \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9 500 \u3067\u5fdc\u7b54\u3057\u3066\u307f\u3066\u3001\u3082\u3046\u5fdc\u7b54\u6e08\u307f\u306a\u3089\u3070\n            # \u767a\u751f\u3059\u308b\u4f8b\u5916\u306f\u7121\u8996\u3059\u308b\u3002\n            try:\n                start_response('500 INTERNAL SERVER ERROR', [\n                               ('Content-Type', 'text\/plain')])\n            except:\n                pass\n            yield 'n'.join(traceback)\n\n        # wsgi applications might have a close function. If it exists\n        # it *must* be called.\n        # wsgi \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u306f close \u95a2\u6570\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\n        # \u3042\u308b\u5834\u5408\u306f\u547c\u3073\u51fa\u3057 *\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044* \u3002\n        if hasattr(appiter, 'close'):\n            appiter.close()\n<\/code><\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306f\u3069\u3046\u3084\u3063\u3066\u4f7f\u3046\u304b\uff1fWSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u524d\u306e\u4f8b\u307f\u305f\u3044\u306b <br \/>\napplication \u306a\u5834\u5408\u3001\u30e9\u30c3\u30d7\u3059\u308c\u3070\u826f\u3044\uff1a<\/p>\n<p><code><\/code><\/p>\n<pre><code>application = ExceptionMiddleware(application)\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001\u767a\u751f\u3059\u308b\u4f8b\u5916\u306f\u5168\u3066\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u3066\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n\u3082\u3061\u308d\u3093\u3001\u307e\u3055\u306b\u3053\u306e\u3053\u3068\u30d7\u30e9\u30b9\u3088\u308a\u591a\u304f\u306e\u6a5f\u80fd\u3092\u3084\u3063\u3066\u304f\u308c\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306f<br \/>\n\u305f\u304f\u3055\u3093\u3042\u308b\u304b\u3089\u3053\u308c\u3092\u3059\u308b\u5fc5\u8981\u306f\u7121\u3044\u3093\u3060\u3051\u3069\u3082\u3002<\/p>\n<p>\n<strong>* \u30c7\u30d7\u30ed\u30a4<\/strong><br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c &#8220;\u5b8c\u6210&#8221; \u3057\u305f\u306e\u3067\u3053\u308c\u3092\u3069\u3046\u306b\u304b\u3057\u3066\u672c\u756a\u30b5\u30fc\u30d0\u306b<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u3002\u3082\u3061\u308d\u3093 mod_proxy \u306e\u5f8c\u308d\u3067 wsgiref \u3092<br \/>\n\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3051\u3069\u3001\u3082\u3063\u3068\u6d17\u7df4\u3055\u308c\u305f\u65b9\u6cd5\u3060\u3063\u3066\u3042\u308b\u3093\u3060\u3002\u591a\u304f\u306e\u4eba\u306f<br \/>\nWSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092 FastCGI \u4e0a\u3067\u4f7f\u3046\u65b9\u6cd5\u3092\u597d\u3080\u3002flup \u304c<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u30ad\u30df\u304c\u3084\u308b\u3053\u3068\u306f myapplication.fcgi \u3092<br \/>\n\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3060\uff1a<\/p>\n<p><code><\/code><\/p>\n<pre><code>#!\/usr\/bin\/python\nfrom flup.server.fcgi import WSGIServer\nfrom myapplication import application\nWSGIServer(application).run()\n<\/code><\/pre>\n<p>apache \u306e\u8a2d\u5b9a\u306f\u3053\u3093\u306a\u98a8\u306b\u306a\u308b\uff1a<\/p>\n<p><code><\/code><\/p>\n<pre><code>\n    ServerName www.example.com\n    Alias \/public \/path\/to\/the\/static\/files\n    ScriptAlias \/ \/path\/to\/myapplication.fcgi\/\n\n<\/code><\/pre>\n<p>\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u7528\u306e\u7bc0\u3082\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u3002\u3082\u3057\u958b\u767a\u9014\u4e2d\u3001<br \/>\nWSGI \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4e2d\u3067\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3082\u63d0\u4f9b\u3057\u305f\u3044\u5834\u5408\u306b\u306f<br \/>\n\u3044\u304f\u3064\u304b\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304c\u5229\u7528\u53ef\u80fd\u3060\u3002<br \/>\n\uff08werkzeug\u3001paste \u3068 Luke Arno \u306e\u30c4\u30fc\u30eb\u306e &#8220;static&#8221; \u3082\u3053\u308c\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\uff09<\/p>\n<p>\n<strong>* NIH \/ DRY<\/strong><br \/>\n&#8220;Not Invented Here\uff08\u81ea\u5bb6\u88fd\u3058\u3083\u306a\u3044\uff09&#8221;\u554f\u984c\u3092\u907f\u3051\u3001\u540c\u3058\u3053\u3068\u3092\u4f55\u3079\u3093\u3082\u7e70\u308a\u8fd4\u3055\u306a\u3044\u3053\u3068\u3002<br \/>\n\u65e2\u5b58\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u5229\u7528\u305b\u3088\uff01\u3067\u3082\u591a\u3059\u304e\u3066\uff01\u3069\u308c\u3092\u4f7f\u304a\u3046\uff01\u30aa\u30b9\u30b9\u30e1\u306f\u3042\u308b\u3088\u3002<\/p>\n<p><strong>** \u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/strong><br \/>\nRuby on Rails \u304c\u767b\u5834\u3057\u3066\u304b\u3089\u3068\u3044\u3046\u3082\u306e\u3001\u307f\u3093\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u8a71\u3092\u3057\u3066\u3044\u308b\u3002<br \/>\nPython \u306b\u3082\u30e1\u30b8\u30e3\u30fc\u306a\u306e\u304c 2 \u3064\u3042\u308b\u30021 \u3064\u306f\u30e2\u30ed\u30e2\u30ed\u3092\u3059\u3054\u3044<br \/>\n\u62bd\u8c61\u5316\u3057\u305f Django \u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3082\u306e\u3067\u3001\u3082\u3046 1 \u3064\u306f WSGI \u306b\u305a\u3063\u3068\u8fd1\u3044<br \/>\nPylong \u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3082\u306e\u3060\u3002Django \u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u914d\u5e03\u3057\u306a\u3044\u306a\u3089\u3070<br \/>\n\u30e4\u30d0\u3044\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002Web \u30da\u30fc\u30b8\u3092\u4e00\u77ac\u3067\u4f5c\u308b\u6642\u3002\u4e00\u65b9\u3067 Pylons \u306f<br \/>\n\u30c7\u30d9\u30ed\u30c3\u30d1\u306e\u4f5c\u696d\u3092\u5fc5\u8981\u3060\u3051\u3069\u30c7\u30d7\u30ed\u30a4\u306f\u305a\u3063\u3068\u7c21\u5358\u3060\u3002<\/p>\n<p><strong>** \u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30e9\u30a4\u30d6\u30e9\u30ea<\/strong><br \/>\n\u591a\u304f\u306e\u5834\u5408\u3001\u5168\u90e8\u5165\u308a\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306f\u5fc5\u8981\u306a\u3044\u3002\u305d\u308c\u306f\u30ad\u30df\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u306f<br \/>\n\u5927\u304d\u3059\u304e\u308b\u304b\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u89e3\u6c7a\u3059\u308b\u306b\u306f\u8907\u96d1\u3059\u304e\u308b\u3002\uff08\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067<br \/>\n\u306a\u306b\u3092\u89e3\u6c7a\u3057\u3066\u3082\u3044\u3044\u3093\u3060\u3051\u3069\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u300c\u52a9\u3051\u300d\u3092\u501f\u308a\u306a\u3044\u3088\u308a\u3082\u305a\u3063\u3068<br \/>\n\u3084\u3084\u3053\u3057\u304f\u306a\u308a\u5f97\u308b\u3093\u3060\uff09\u3002<\/p>\n<p>\u3053\u3093\u306a\u6642\u306e\u305f\u3081\u306b\u3044\u304f\u3064\u304b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308b\uff1a<br \/>\n\u30fbpaste &#8212; Pylons \u306e\u821e\u53f0\u88cf\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u3002request \u3068 response \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u3002<br \/>\n\u305f\u304f\u3055\u3093\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3002<br \/>\n\u30fbwerkzeug &#8212; pocoo \u306e\u305f\u3081\u306b\u66f8\u3044\u305f\u6700\u4f4e\u9650\u306e WSGI \u30e9\u30a4\u30d6\u30e9\u30ea\u3002unicode \u5bfe\u5fdc\u306e request \/ response<br \/>\n\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u5148\u9032\u7684\u306a URL \u30de\u30c3\u30d1\u3001\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30c7\u30d0\u30c3\u30ac\u3092\u5099\u3048\u308b\u3002<br \/>\n\u30fbLuke Arno&#8217;s WSGI helpers &#8212; Luke Arno \u306b\u3088\u308b\u72ec\u7acb\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u306e\u69d8\u3005\u306a WSGI \u30d8\u30eb\u30d1\u30fc\u3002<\/p>\n<p><strong>** \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3<\/strong><br \/>\n\u30dc\u30af\u304c\u3088\u304f\u4f7f\u3044\u3001\u63a8\u85a6\u3059\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u306e\u30ea\u30b9\u30c8\uff1a<br \/>\n\u30fbGenshi &#8212; \u4e16\u754c\u6700\u9ad8\u306e XML \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3002\u3067\u3082\u3061\u3087\u3063\u3068\u9045\u304f\u3066\u3001\u3060\u304b\u3089<br \/>\n\u672c\u5f53\u306b\u826f\u3044\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u5fc5\u8981\u306a\u3089\u5225\u306a\u3082\u306e\u306b\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\n\u30fbMako &#8212; \u30d0\u30ab\u901f\u3044\u30c6\u30ad\u30b9\u30c8\u30d9\u30fc\u30b9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3002\u3053\u308c\u306f<br \/>\nERB\u3001Mason\u3001Django \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30df\u30c3\u30af\u30b9\u3060\u3002<br \/>\n\u30fbJinja &#8212; \u5b89\u5168\u3067\u30c7\u30b6\u30a4\u30ca\u30fc\u5411\u3051\u3067\u304b\u306a\u308a\u901f\u3044\u3001\u30c6\u30ad\u30b9\u30c8\u30d9\u30fc\u30b9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3002<br \/>\n\u30e2\u30c1\u500b\u4eba\u7684\u306b\u306f\u3053\u308c\u3092\u9078\u3076:D<\/p>\n<p>\n<strong>* \u7d50\u8ad6<\/strong><br \/>\nWSGI \u30b9\u30b2\u30fc\u3002\u7c21\u5358\u306b\u500b\u4eba\u7684\u306a\u30b9\u30bf\u30c3\u30af\u304c\u4f5c\u308c\u308b\u3002<br \/>\n\u8907\u96d1\u3059\u304e\u308b\u3068\u601d\u3046\u5834\u5408\u306f werkzeug \u3084 paste \u3092\u898b\u3066\u307f\u308c\u3070\u3001<br \/>\n\u554f\u984c\u3092\u5236\u9650\u306a\u304f\u305a\u3063\u3068\u7c21\u5358\u306b\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\n\u3053\u306e\u8a18\u4e8b\u304c\u5f79\u7acb\u3064\u3053\u3068\u3092\u671b\u307f\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WSGI (Web Server Gateway Interface) \u306f Django \u3084 Google App Engine \u3092\u59cb\u3081\u305f\u304f\u3055\u3093\u306e Python Web \u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u6e96\u62e0\u3057\u3066\u3044\u308b\u4ed5\u69d8\u3067\u3001\u3053\u308c\u306b\u3064\u3044\u3066\u306e\u79c0\u9038\u306a\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u7ffb\u8a33\u3002\u65e5\u672c\u8a9e\u8a33\u304c\u79c0\u9038\u304b\u3069\u3046\u304b\u306f\u77e5\u3089\u306a\u3044\u306e\u3067\u3001\u602a\u3057\u3044\u90e8\u5206\u306f\u539f\u6587\u306b\u3042\u305f\u3063\u3066\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002 WSGI \u3053\u3068\u306f\u3058\u3081 ==================== \u8457\u8005(Author): Armin Ronacher \u539f\u6587(Original Text): http:\/\/lucumr.pocoo.org\/articles\/getting-started-with-wsgi \u7ffb\u8a33(Japanese Translation): hkurosawa \u30e9\u30a4\u30bb\u30f3\u30b9(Lisence): http:\/\/creativecommons.org\/licenses\/by-nc-sa\/2.0\/at\/deed.ja ==================== \u3084\u3063\u3068\u8ad6\u6587\u3082\u7d42\u308f\u3063\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u8a18\u4e8b\u3092\u66f8\u304f\u305f\u3081\u306e\u6642\u9593\u304c\u3067\u304d\u305f\u3002 \u305a\u3063\u3068\u66f8\u304d\u305f\u304b\u3063\u305f\u3082\u306e\u306e\u4e00\u3064\u304c\u3001\u7279\u5b9a\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084\u5b9f\u88c5\u3092 \u5fc5\u8981\u3068\u3057\u306a\u3044 WSGI \u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306a\u3093\u3060\u3002\u3055\u3042\u59cb\u3081\u3088\u3046\u3002 * WSGI \u3063\u3066\u306a\u3093\u3060\uff1f \u57fa\u672c\u7684\u306b\u3001WSGI \u306f\u305f\u3076\u3093\u30ad\u30df\u306e\u3057\u3063\u3066\u308b CGI \u3088\u308a\u3082\u4f4e\u5c64\u306e\u3082\u306e\u3060\u3002 \u3060\u3051\u3069 CGI \u3068\u9055\u3046\u306e\u306f\u3001WSGI \u306f\u30b9\u30b1\u30fc\u30eb\u3059\u308b\u3057\u3001\u30de\u30eb\u30c1\u30b9\u30ec\u30c3\u30c9\u3067\u3082 \u30de\u30eb\u30c1\u30d7\u30ed\u30bb\u30b9\u74b0\u5883\u3067\u3082\u52d5\u4f5c\u3059\u308b\u3001\u306a\u305c\u3063\u3066\u3001\u3053\u308c\u306f\u3069\u3046\u5b9f\u88c5\u3055\u308c\u308b\u304b\u306f \u305c\u3093\u305c\u3093\u6c17\u306b\u3057\u3066\u306a\u3044\u4ed5\u69d8\u3060\u304b\u3089\u3060\u3002\u4e8b\u5b9f\u3001 WSGI \u306f Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068 \u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u306e CGI\u3001mod_python\u3001FastCGI \u307e\u305f\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1021","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1021"}],"version-history":[{"count":1,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1021\/revisions"}],"predecessor-version":[{"id":1022,"href":"https:\/\/rawbytes.org\/index.php?rest_route=\/wp\/v2\/posts\/1021\/revisions\/1022"}],"wp:attachment":[{"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rawbytes.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}