{"id":4078,"date":"2019-11-01T07:01:53","date_gmt":"2019-11-01T06:01:53","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=4078"},"modified":"2019-11-03T05:51:45","modified_gmt":"2019-11-03T04:51:45","slug":"video-python-3-on-glitch-com","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/video-python-3-on-glitch-com\/","title":{"rendered":"Video: Python 3 on Glitch.com"},"content":{"rendered":"<p>Today I am gonna show you how simple is to create a web progressive app with Python on Glitch.com. To see the code seen in the video, go to the post linked below. You will need an account on Glith.com, a project and three files:<\/p>\n<ul>\n<li>requirements.txt (with just the word flask in it)<\/li>\n<li>glitch.json (configuration of the files to start with)<\/li>\n<li>server.py (the python code to launch the server and the site)<\/li>\n<\/ul>\n<p>It requires just a little effort to start using Python on the web, finally. To learn how to create the pages with Flask, go check my posts about it, look at the links at the bottom of the page.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"MDLRuYdWO2\"><p><a href=\"https:\/\/pythonprogramming.altervista.org\/flask-and-python-3-on-glitch-in-a-couple-of-lines\/\">Flask and Python 3 on Glitch&#8230; in a couple of lines<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Flask and Python 3 on Glitch&#8230; in a couple of lines&#8221; &#8212; python programming\" src=\"https:\/\/pythonprogramming.altervista.org\/flask-and-python-3-on-glitch-in-a-couple-of-lines\/embed\/#?secret=sN89C18UZf#?secret=MDLRuYdWO2\" data-secret=\"MDLRuYdWO2\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2>Presentation of the code<\/h2>\n<p>In the following video I show the web app with flask and Python on Glitch.com.<\/p>\n<p><iframe loading=\"lazy\" title=\"Get Python 3 on the web with Flask and Glitch.com (free with 6 lines of code)\" width=\"747\" height=\"560\" src=\"https:\/\/www.youtube.com\/embed\/6oAWNIh0kdM?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>The live code<\/h2>\n<p><iframe loading=\"lazy\" title=\"How to use Python on Glitch.com ... live code\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/u8zzSdrbF4k?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<script>\r\n\tif (typeof title != \"undefined\")\r\n\t{let title = \"Glitch.com (with flask)\";\r\n\tlet links = [];}\r\n\telse\r\n\t{title = \"Glitch.com (with Flask)\";}\r\n\r\n\tlinks = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/how-to-authorize-users-to-access-to-personal-pages-with-glitch-com\/\",\"Access with auth on glitch.me\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/video-python-3-on-glitch-com\/\",\"Python 3 on Glitch (Live code)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-and-python-3-on-glitch-in-a-couple-of-lines\/\",\"Python 3 on Glitch with Flask (2)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-on-glitch-com-without-flask\/\",\"Python on Glitch.com without flask\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-3-with-flask-on-glitch-com\/\",\"Python 3 on Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-flask-on-glitch-edited-with-visual-studio-code\/\",\"Visual studio code and Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/how-to-import-a-blog-on-glitch-com-from-github\/\",\"Import site from Github in Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/publish-app-or-blog-with-glitch-com-and-python-in-no-time\/\",\"Publish a Flask Blog in Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/put-our-flask-blog-on-glitch-com-for-free\/\",\"Free Flask blog wiht Python on GLitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/a-brief-guide-to-pil-python-image-library\/\",\"My Flask site on PIL on Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/how-to-render-html-into-flask-variables-passed-to-the-pages\/\",\"Render Html in Flask on Glitch.com\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/what-if-you-got-dns_probe_finished_nxdomain-with-glitch-me-sites\/\",\"Cannot see glithc.me site (dns)\"]\r\n\t\t];\t\t \r\n<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n<script>\r\n\tif (typeof title != \"undefined\")\r\n\t{\r\n\t\tlet title = \"Flask\";\r\n\t\tlet links = []\r\n\t}\r\n\telse \r\n\t{\r\n\t\ttitle = \"Flask\";\r\n\t}\r\n\r\nlinks = [\r\n\t\t\t\/\/ -------------------20.9.2019 ---------------------------------\r\n[\"https:\/\/pythonprogramming.altervista.org\/how-to-render-html-into-flask-variables-passed-to-the-pages\/\",\r\n \"Render HTML in Flask\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-12-add-a-navigation-bar-to-the-blog\/\",\"Add a menu (11)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-flask-on-glitch-edited-with-visual-studio-code\/\",\"Visual Studio Code on Glitch (with flask)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-11-bootstrap\/\",\"Bootstrap with Flask(10)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/put-our-flask-blog-on-glitch-com-for-free\/\",\"Free blog with Flask and Glitch.me\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-9-use-css-in-the-template\/\",\"Css on Flask (9)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-8-templates\/\",\"Templates in Flask (8)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-7-the-if-condition\/\",\"The if condition - Flask 7\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-6-jinga2-and-code-into-html-pages\/\",\"jinga2 and code in Html page in Flask (6)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-and-flask-blog-part-5\/\",\"Python and flask 5\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/setting-up-flask-to-make-our-blog\/\",\"Setting up Flask 5\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-p-3-lets-make-the-first-web-pages\/\",\"Flask 1st web page 4\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/flask-2-use-visual-studio-code-in-the-environment\/\",\"Visual code and Flask 3\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/install-flask-in-a-brand-new-environment\/\",\"Flask in a new Python environment 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/on-the-web-with-python-and-flask-1\/\",\"Web with flask 1\"]\r\n];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n","protected":false},"excerpt":{"rendered":"A video about Flask, Python 3 and Glitch.com combined to make a web progressive app in the fastest and easiest way possible.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/video-python-3-on-glitch-com\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":4086,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[420,431,611],"tags":[346,432,433,538,4,615],"class_list":["post-4078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flask","category-glitch-com","category-python-3","tag-flask","tag-glitch","tag-glitch-com","tag-glitch-me","tag-python","tag-wpa"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":true,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=4078"}],"version-history":[{"count":7,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4078\/revisions"}],"predecessor-version":[{"id":4100,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4078\/revisions\/4100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/4086"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=4078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=4078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=4078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}