{"id":14704,"date":"2018-05-14T16:19:18","date_gmt":"2018-05-14T07:19:18","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=14704"},"modified":"2018-05-14T16:20:17","modified_gmt":"2018-05-14T07:20:17","slug":"flask-ask%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%9falexa%e3%82%b9%e3%82%ad%e3%83%ab%e9%96%8b%e7%99%ba","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/flask-ask%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%9falexa%e3%82%b9%e3%82%ad%e3%83%ab%e9%96%8b%e7%99%ba\/","title":{"rendered":"Flask-ask\u3092\u5229\u7528\u3057\u305fAlexa\u30b9\u30ad\u30eb\u958b\u767a"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u4eca\u56de\u306fFlask-ask\u3092\u5229\u7528\u3057\u305fAlexa\u30b9\u30ad\u30eb\u958b\u767a\u3067\u306e\u30c7\u30d7\u30ed\u30a4\u65b9\u6cd5\u3084\u30b9\u30ad\u30eb\u3092\u516c\u958b\u3059\u308b\u3068\u304d\u306e\u5be9\u67fb\u3067\u5927\u5909\u3060\u3063\u305f\u3053\u3068\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u524d\u7de8 Alexa\u3067\u30b9\u30ab\u30a4\u30a2\u30fc\u30c1\u30b9\u30ad\u30eb\u3092\u516c\u958b\u3057\u307e\u3057\u305f<br \/>\n- <a href=\"https:\/\/www.skyarch.net\/blog\/?p=14637\">https:\/\/www.skyarch.net\/blog\/?p=14637<\/a><\/p>\n<h2>\u76ee\u6b21<\/h2>\n<ul>\n<li><a href=\"#flask-ask\">Flask-Ask\u3092\u5229\u7528\u3057\u305fAlexa\u30b9\u30ad\u30eb\u958b\u767a<\/a><\/li>\n<li><a href=\"#overview\">\u6982\u8981<\/a><\/li>\n<li><a href=\"#deploy\">\u30c7\u30d7\u30ed\u30a4\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"#difficult\">\u30b9\u30ad\u30eb\u516c\u958b\u306b\u95a2\u3057\u3066\u5927\u5909\u3060\u3063\u305f\u3053\u3068<\/a><\/li>\n<\/ul>\n<h2 id=\"flask-ask\">Flask-Ask\u3092\u5229\u7528\u3057\u305fAlexa\u30b9\u30ad\u30eb\u958b\u767a<\/h2>\n<h3 id=\"overview\">\u6982\u8981<\/h3>\n<p>Flask-ask\u3068\u306fFlask\u3068\u547c\u3070\u308c\u308bPython\u7528\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067Alexa Skills Kit(ASK)\u306e\u958b\u767a\u3092\u3059\u308b\u305f\u3081\u306e\u62e1\u5f35\u6a5f\u80fd\u3068\u3057\u3066\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3 id=\"deploy\">\u30c7\u30d7\u30ed\u30a4\u65b9\u6cd5<\/h3>\n<p>\u307e\u305a\u3001\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066Flask-ask\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npip install flask-ask\n<\/pre>\n<p>\u307e\u305f\u3001Zappa\u3068\u3044\u3046\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001Flask-ask\u3067\u4f5c\u6210\u3057\u305f\u3082\u306e\u3092AWS\u4e0a\u306b\u81ea\u52d5\u3067\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001Zappa\u304c\u4f9d\u5b58\u3057\u3066\u3044\u308bVirtualenv\u3068\u4e00\u7dd2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npip install zappa virtualenv\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u3089\u3001Virtualenv\u3067\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nvirtualenv venv\n<\/pre>\n<p>Virtualenv\u3067\u4f5c\u6210\u3057\u305f\u4eee\u60f3\u74b0\u5883\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsource venv\/bin\/activate\n<\/pre>\n<p>Zappa\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nzappa init\n<\/pre>\n<p>\u74b0\u5883\u540d\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u3001\u958b\u767a\u74b0\u5883\u3067\u3042\u308c\u3070<code>dev<\/code>\u3068\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nWhat do you want to call this environment (default &#039;dev&#039;): dev\n<\/pre>\n<p>\u305d\u306e\u5f8c\u306eS3\u30d0\u30b1\u30c3\u30c8\u540d\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u3001\u5909\u66f4\u304c\u5fc5\u8981\u3067\u3042\u308c\u3070\u5165\u529b\u3057\u3001\u5fc5\u8981\u306a\u3051\u308c\u3070\u305d\u306e\u307e\u307e\u30a8\u30f3\u30bf\u30fc\u3092\u62bc\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nYour Zappa deployments will need to be uploaded to a private S3 bucket.\nIf you don&#039;t have a bucket yet, we&#039;ll create one for you too.\nWhat do you want call your bucket? (default &#039;zappa-xxxxxxxxx&#039;):\n<\/pre>\n<p>\u6b21\u306b\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u540d\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u3001\u4eca\u56de\u306f<code>main.app<\/code>\u3068\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nWhere is your app&#039;s function?: main.app\n<\/pre>\n<p>\u6b21\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u306b\u5c55\u958b\u3059\u308b\u304b\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u3001<code>n<\/code>\u3068\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nIf you are using Zappa for the first time, you probably don&#039;t want to do this!\nWould you like to deploy this application globally? (default &#039;n&#039;) &#x5B;y\/n\/(p)rimary]: n\n<\/pre>\n<p>\u3059\u308b\u3068\u3001zappa_settings.json\u306e\u4e2d\u8eab\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u6b63\u3057\u3051\u308c\u3070<code>y<\/code>\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u3001\u8a2d\u5b9a\u3092\u5b8c\u4e86\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nDoes this look okay? (default &#039;y&#039;) &#x5B;y\/n]: y\n<\/pre>\n<p>\u4f5c\u6210\u524d\u306e\u4e0b\u6e96\u5099\u306f\u3053\u308c\u3067\u5b8c\u4e86\u3057\u305f\u306e\u3067\u3001<code>main.py<\/code>\u30d5\u30a1\u30a4\u30eb\u306bAlexa\u30b9\u30ad\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u4f5c\u6210\u304c\u5b8c\u4e86\u3057\u305f\u3089Zappa\u3067\u30c7\u30d7\u30ed\u30a4\u3092\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nzappa delpoy {\u74b0\u5883\u540d(\u4eca\u56de\u306fdev)}\n<\/pre>\n<p>\u30c7\u30d7\u30ed\u30a4\u304c\u5b8c\u4e86\u3059\u308b\u3068APIGateway\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001Alexa\u30b9\u30ad\u30eb\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306b\u8a2d\u5b9a\u3059\u308b\u3068\u4f5c\u6210\u3057\u305f\u30b9\u30ad\u30eb\u304c\u624b\u6301\u3061\u306e\u30c7\u30d0\u30a4\u30b9\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002<br \/>\n\u30b3\u30fc\u30c9\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u6642\u306f\u4ee5\u4e0b\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u884c\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nzappa update {\u74b0\u5883\u540d(\u4eca\u56de\u306fdev)}\n<\/pre>\n<h3 id=\"difficult\">\u30b9\u30ad\u30eb\u516c\u958b\u306b\u95a2\u3057\u3066\u5927\u5909\u3060\u3063\u305f\u3053\u3068<\/h3>\n<p>Alexa\u30b9\u30ad\u30eb\u3067\u306f\u3001\u516c\u958b\u524d\u306bAmazon\u306e\u57fa\u6e96\u306b\u9069\u5408\u3057\u3066\u3044\u308b\u304b\u306e\u5be9\u67fb\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306e\u30b9\u30ad\u30eb\u3067\u306fAudioPlayer\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>\u4e2d\u65ad\u30fb\u518d\u958b\u6a5f\u80fd<\/li>\n<li>\u30ad\u30e3\u30f3\u30bb\u30eb\u6a5f\u80fd<\/li>\n<li>\u30eb\u30fc\u30d7\u518d\u751f\u6a5f\u80fd<\/li>\n<li>\u524d\u306e\u66f2\u3084\u6b21\u306e\u66f2\u3078\u306e\u30b7\u30fc\u30af\u6a5f\u80fd<\/li>\n<li>\u7d42\u4e86\u5f8c\u306b\u540c\u3058\u66f2\u3092\u518d\u751f\u3057\u76f4\u3059\u6a5f\u80fd<\/li>\n<li>\u30b7\u30e3\u30c3\u30d5\u30eb\u518d\u751f\u6a5f\u80fd<\/li>\n<li>\u518d\u751f\u4e2d\u306e\u66f2\u3092\u6700\u521d\u304b\u3089\u518d\u751f\u3057\u76f4\u3059\u6a5f\u80fd<\/li>\n<li>\u66f2\u306e\u505c\u6b62\u6a5f\u80fd<\/li>\n<\/ul>\n<p>\u3053\u308c\u3089\u306f\u518d\u751f\u3059\u308b\u66f2\u304c1\u66f2\u306e\u307f\u3067\u3042\u308b\u3068\u304d\u3082\u5b9f\u88c5\u306e\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306f\u547c\u3073\u51fa\u3055\u308c\u305f\u969b\u306b\u306f\u30a8\u30e9\u30fc\u304c\u51fa\u305a\u306b\u30e6\u30fc\u30b6\u30fc\u3078\u304d\u3061\u3093\u3068\u8fd4\u7b54\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3068\u3044\u3046\u6307\u6458\u3092\u4f55\u56de\u304b\u53d7\u3051\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u56de\u306f\u3001\u30eb\u30fc\u30d7\u518d\u751f\u6a5f\u80fd\u3068\u30b7\u30fc\u30af\u6a5f\u80fd\u30fb\u30b7\u30e3\u30c3\u30d5\u30eb\u518d\u751f\u6a5f\u80fd\u306f\u547c\u3073\u51fa\u3055\u308c\u3066\u3082\u300c\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u300d\u3068\u8fd4\u7b54\u3059\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002<br \/>\n\u5b9f\u306f\u3001\u97f3\u697d\u4e2d\u65ad\u5f8c\u306e\u518d\u958b\u90e8\u5206\u304c\u4e00\u756a\u5927\u5909\u3067\u3001Flask-ask\u3067\u306f\u97f3\u697d\u518d\u751f\u5f8c\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u4fdd\u6301\u3057\u3066\u306f\u304f\u308c\u308b\u3082\u306e\u306e\u3001\u518d\u958b\u53ef\u80fd\u304b\u306a\u3069\u306e\u5224\u65ad\u306f\u3057\u3066\u304f\u308c\u306a\u3044\u306e\u3067\u3001\u81ea\u5206\u3067\u5909\u6570\u304b\u3089\u78ba\u8a8d\u3057\u3001\u6761\u4ef6\u5f0f\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br \/>\n\u307e\u305f\u3001\u30d8\u30eb\u30d7(Alexa\u304b\u3089\u547c\u3073\u51fa\u3059)\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u30d8\u30eb\u30d7\u306f\u30b9\u30ad\u30eb\u304c\u3069\u306e\u3088\u3046\u306b\u52d5\u304f\u304b\u3092\u7d30\u304b\u304f\u8aac\u660e\u3057\u305f\u4e0a\u3067\u6700\u5f8c\u306b\u30e6\u30fc\u30b6\u30fc\u3078\u767a\u8a71\u3092\u4fc3\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30b9\u30c8\u30a2\u306b\u3042\u308b\u30a2\u30d7\u30ea\u306e\u8aac\u660e\u3068\u540c\u3058\u6587\u7ae0\u3092\u6700\u521d\u306b\u5165\u308c\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001<code>\u30b9\u30ad\u30eb\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044<\/code>\u3068\u6307\u6458\u3092\u3055\u308c\u3001\u30b9\u30c8\u30a2\u306e\u8aac\u660e\u3088\u308a\u3082\u8a73\u3057\u304f\u8aac\u660e\u3057\u305f\u3068\u3053\u308d\u6307\u6458\u306f\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u5be9\u67fb\u6642\u306b\u30a8\u30e9\u30fc\u306a\u3069\u304c\u8d77\u304d\u308b\u3068\u3069\u306e\u3088\u3046\u306a\u72b6\u6cc1\u3067\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u306e\u304b\u3092\u30e1\u30fc\u30eb\u3067\u6559\u3048\u3066\u3044\u305f\u3060\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u3082\u3068\u306b\u4fee\u6b63\u3057\u3066\u3044\u3051\u3070\u305d\u306e\u3046\u3061\u5be9\u67fb\u3092\u901a\u904e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u4eca\u56de\u306fFlask-ask\u3092\u5229\u7528\u3057\u305fAlexa\u30b9\u30ad\u30eb\u958b\u767a\u3067\u306e\u30c7\u30d7\u30ed\u30a4\u65b9\u6cd5\u3084\u30b9\u30ad\u30eb\u3092\u516c\u958b\u3059\u308b\u3068\u304d\u306e\u5be9\u67fb\u3067\u5927\u5909\u3060\u3063\u305f\u3053\u3068\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002 \u524d\u7de8 Alexa\u3067\u30b9\u30ab\u30a4\u30a2\u30fc\u30c1\u30b9\u30ad\u30eb\u3092\u516c\u958b\u3057\u307e\u3057\u305f &#8211; https:&#8230;<\/p>\n","protected":false},"author":1,"featured_media":14639,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"14704","footnotes":""},"categories":[316,20,19,276,265,75],"tags":[],"class_list":{"0":"post-14704","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-alexa","8":"category-aws","9":"category-19","10":"category-serverless","11":"category-265","12":"category-75","13":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/14704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=14704"}],"version-history":[{"count":37,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/14704\/revisions"}],"predecessor-version":[{"id":14763,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/14704\/revisions\/14763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/14639"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=14704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=14704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=14704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}