Replit
Replit is an online IDE and hosting platform for web apps written in any language. Their free tier allows running any number of apps with some performance limitations.
To run your app on Replit:
-
Sign up on Replit.
-
Click "New Repl" button, select "Python" template and type the name of your repl, e.g.
my-flet-app
. Alternatively, go to Flet template page and click Use Template button. Flet template has everything configured for you, so you can jump tomain.py
and update your program right away. -
Open
.replit
file on the left and add these two options to the root:
# Stops the packager from installing packages when running the Repl
disableInstallBeforeRun = true
# Stops the packager from guessing and auto-installing packages, but it still runs to install packages when running the Repl
disableGuessImports = true
- On "Tools" pane click "Packages" and search for
flet
package and click "Install" button. - Open
main.py
on "Files" pane and copy-paste your app. - Modify call to
ft.app()
and includeview=ft.AppView.WEB_BROWSER
parameter:
ft.app(main, view=ft.AppView.WEB_BROWSER)
-
Run the app. Enjoy.