The gh-pages
branch of this repo contains the slides for PyScript and my journey to the Web. The presentation contents are licensed under CC-BY-4.0. The slides are available at https://sjirwin.github.io/pyscript-journey/ and are rendered using reveal.js via GitHub pages.
The main
branch contains code that was written as part of my PyScript journey. Any code in this repo which is authored by me is covered by the MIT license.
The repo does contain some code obtained from open source projects (e.g., PyScript). Any such code is covered by the original projects' licenses.
Direct Dependancies
hello_world
: a very basic "Hello World" web page implemented using PyScript. You should be able to load this directly into your browser viaFile
->Open
(i.e., no web server should be needed). An internet connection is required since the page will dynamically download PyScript and Pyodide. Pyodide in particular is quite large (281 Mb as of this writing) so if you are not blessed with a fast internet connection, the page might take some time to load and render.flask-hello_world
: a trivial Flask app used to verify that Flask is installed correctly.server
: the main Flask app. This has been configured to use a local, static copy of PyScript and Pyodide. The PyScript files are included in this repo and reside inserver/static/pyscript
(these were copied from pyscript.net/alpha on 2022-Aug-07). Given its size, Pyodide is not included and must be downloaded from its releases page (details below).
I used Python 3.10 during development. However any modern, supported version of Python should work ("Your milage may vary").
- Create a virtual environment and install Flask (assumes
pip
is installed)
python3.10 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Test that the web server is installed and works on
localhost
cd flask-hello_world
flask run --port 5050 # avoid standard port
- Check that the flask app works on localhost
- PyScript : as mentioned above, the PyScript files are included in this repo. They reside in
server/static/pyscript
- Pyodide : because of its size, Pyodide is not included and must be downloaded from its releases page. The code in this repo assumes version 0.21 (I used 0.21.1).
- Download version 0.21.1 from the GitHub releases page
- Unpack the
tar.bz2
file - Move the
pyodide
directory toserver/static
- Verify that everything is working
- Start the server (assumes venv is still active)
cd server
flask run
- Load the hello page from
localhost
- If you are able to load the hello page, then the mortgage calulator app should also be loadable
- Load the mortgage app from
localhost
- Load the mortgage app from