In this lab, we will learn new ways to host our projects and web apps remotely so they can be more accessible.
Complete an Anvil tutorial of your choice.
Send temperature and humidity readings from the Sense HAT to an Anvil client app.
Create a drawing app that lets you “paint by numbers” on the Sense Hat 8x8 Matrix.
Convert a Flask project to Anvil (Nasa API for example)
Work on previous Flask projects to forward to Ngrok for others to see.
Previously, we had hosted all of our projects locally. This term, we will learn how to host our web apps remotely so that they can be accessed from anywhere, rather than just on the local network.
Anvil is a platform that allows you to build apps using Python, including the user interface and server logic, while still giving you the possibility to control CSS and HTML elements, if desired. We will use this service to host apps that talk to our Raspberry Pis, as well as 3rd party APIs
Ngrok a service that will allow you to expose your Flask apps (or other web servers running on a local network) to the rest of the Internet. It creates secure “tunnels” that redirect web traffic to your app.
Launch an existing Flask web app of your choice. Make sure your app is ready to go and does not need too much debugging. Make sure to note the port you are using! Flask’s default port is 5000.
Sign up for Ngrok and read the Getting Started section, and others as needed.
Follow the instructions for Exposing a Web Server.
Obtain your url and share with others!
*Note: livestream apps will only accept one client at a time.
The URL you get from Ngrok is temporary and will only survive while your app is running. Make sure to stop the server after the activity is done.
Resources: