{"id":583,"date":"2018-11-26T20:57:22","date_gmt":"2018-11-27T04:57:22","guid":{"rendered":"http:\/\/dragonwarz.net\/?p=583"},"modified":"2019-12-06T15:34:21","modified_gmt":"2019-12-06T23:34:21","slug":"flask-seems-a-good-fit","status":"publish","type":"post","link":"https:\/\/dragonwarz.net\/?p=583","title":{"rendered":"Flask seems a good fit"},"content":{"rendered":"\n<p>I was looking for a better way to do my Network Server commands, so I headed over to the Python IRC channel and asked for some better ways to send text across the network.\u00a0 After some chatting back and forth someone mentioned HTTP and REST, so I started my research.\u00a0 It didn&#8217;t take long to find Django (what I used before) and Flask (I saw before, but haven&#8217;t used).\u00a0 So I looked around trying to see what the purpose and differences of the 2 are.\u00a0 It was obvious pretty quickly that Flask was the one.\u00a0 My commands and data are pretty basic, so having a micro framework to send and receive made sense.\u00a0 There also seems to be a lot of module attachments to enhance Flask, so future expansion is there.\u00a0\u00a0<br><\/p>\n\n\n\n<p>I have now replaced my basic sockets server with Flask.\u00a0 I have to admit, there&#8217;s a lot to like.\u00a0 For one, I can just go to the URL of the sensor in a web browser to view results!\u00a0 Soo very helpful during testing to see if anything looks off.\u00a0 This also opens up possible phone apps that just use a wrapper around a web browser.\u00a0 It would be pretty sweet to use my\u00a0phone to interact with sensors.\u00a0\u00a0<\/p>\n\n\n\n<p>Definitely a few more possibilities in the near future.&nbsp; I still have to rework some of my unit tests and actually test the program a bit more, since I just overhauled the network service, but so far it&#8217;s looking pretty good.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Lots to do, so back to it I go.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was looking for a better way to do my Network Server commands, so I headed over to the Python IRC channel and asked for some better ways to send text across the network.\u00a0 After some chatting back and forth &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/dragonwarz.net\/?p=583\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,27,26,3],"tags":[33],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-programming","category-project","category-python","category-random","tag-kootnet-sensors"],"_links":{"self":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=583"}],"version-history":[{"count":5,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/583\/revisions\/590"}],"wp:attachment":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}