- Login to codesandbox and possibly click the left most box and choose the dashboard
- Create a devbox and search for "docker"
- In the
.devcontainer
find theDockerfile
and replaceFROM ubuntu
withFROM python:3.12
savectrl-S
and let that install - Open a new terminal near the bottom of the page.
- test if python is installed
python3 --version
and test if pip is installedpip3 --version
- test if
python -V
andpip -V
work, note it is a captial V, most other Ubuntu versions checks use a small v - install flask
pip3 install Flask
Note: many installations on Ubuntu useapt install ????
but this time we use pip. - Check if flask was installed
flask --version
- Copy the 2 files
tz07-flask.py
andtz07-web.py
near the README.md file, or just creatte the files and copy the code - Don't forget to save the files with
ctrl-s
- In the terminal activate the flask code which calls the pure python code
python3 tz07-flask.py
- copy the generated URL to your
index.html
page
#alternate methods:
- Choose the default codesandbox ubuntu docker
Ctrl `
to open a new terminaluname -a
thenapt update
thenaptupgrade
thenapt update
thenuname -a
apt install python3
thenpython3 -V
apt install python3-pip
thenpip -V
pip install flask
- Copy the 2 files
tz07-flask.py
andtz07-web.py
near the README.md file, or just creatte the files and copy the code - Don't forget to save the files with
ctrl-s
- In the terminal activate the flask code which calls the pure python code
python3 tz07-flask.py
- copy the generated URL to your
index.html
page
I just setup nodejs with npm and tried a new file called myNode.js
which works in the same way
codesandbox to fork https://codesandbox.io/p/devbox/jovial-dan-pq7mxy
web page https://pq7mxy-5000.csb.app/upload