Python 3 with Flask on Glitch.com!

Finally we can use Python 3 on Glitch.com with Flask to create app or sites or blogs or whatever you need to be on the web with the beauty of Python, the most elegant language ever.

In the following video you will see me exploring the remixed code to use flask with Python 3 on glitch.com. I talked about glitch.me and flask in many posts, but I always used python 2 for that. Now I found this code and tried it on my sites and I saw all the benefits of this upgrade.

Why?

  • First: I use Python 3, so I am more at ease with it;
  • second: Python 2 will be non longer supported
  • third: it is faster, the changes on the site (even in the html files) are now immediate, while it took some minutes with python 2 (you could not predict when the changes would be applied and if there was something that was not going well, so now it is a pleasure to see immediately the effect of your modifications)

What you need to do it

You need these files:

  • InstallReqsAndStart.sh
  • package.json
  • watch.json
  • server.py

InstallReqsAndStart.sh

package.json

requirements.txt

server.py

This will create just a line with two words (Hello World) in the page. To see how to create a complex site, go in the links at the end of the post.

 

The video with the live discovery of Python 3 on Glitch.com

Examples of sites with flask and python3

How to import the code you see in pil.glitch.me

Go inĀ tool in the left bottom of the screen of the glitch page and then, from the menu, click on import from glitch (2 times). On the pop up window insert formazione/flask and you will get the code that you will personalize.