diff --git a/en/step_1.md b/en/step_1.md index 318911c..86da702 100644 --- a/en/step_1.md +++ b/en/step_1.md @@ -24,5 +24,7 @@ language: bash line_numbers: false --- sudo apt install python3-flask + --- /code --- + --- /collapse --- \ No newline at end of file diff --git a/en/step_2.md b/en/step_2.md index 02bda84..bec18b7 100644 --- a/en/step_2.md +++ b/en/step_2.md @@ -1,6 +1,7 @@ ## Create the app --- task --- + Open a terminal and use the `mkdir` command to create a new directory inside your documents folder called `webapp`. --- code --- @@ -9,6 +10,7 @@ language: bash line_numbers: false --- mkdir ~/Documents/webapp + --- /code --- --- /task --- @@ -23,12 +25,17 @@ language: bash line_numbers: false --- cd ~/Documents/webapp + --- /code --- + --- /task --- --- task --- + From the **Programming** menu, open **Thonny**. + --- /task --- + --- task --- Add this Python code into the blank file. @@ -48,15 +55,20 @@ def index(): if __name__ == '__main__': app.run(debug=True, host='0.0.0.0') + --- /code --- + --- /task --- --- task --- + Save the new file with the name `app.py` inside the `webapp` folder you just created. + --- /task --- --- task --- + Go back to your terminal window and run the script you just wrote: --- code --- @@ -65,6 +77,7 @@ language: bash line_numbers: false --- python3 app.py + --- /code --- --- /task --- @@ -74,10 +87,13 @@ If everything is working correctly, the window should show you output similar to  --- task --- + From your Raspberry Pi's menu, open **Internet** > **Chromium web browser** + --- /task --- --- task --- + In the address bar, type `localhost:5000` and press Enter. You should see the welcome page. --- /task --- diff --git a/en/step_3.md b/en/step_3.md index f509487..7723ca6 100644 --- a/en/step_3.md +++ b/en/step_3.md @@ -41,6 +41,7 @@ def index(): @app.route('/cakes') def cakes(): return 'Yummy cakes!' + --- /code --- --- /task --- diff --git a/en/step_4.md b/en/step_4.md index cee6cf1..7eeb6cb 100644 --- a/en/step_4.md +++ b/en/step_4.md @@ -2,12 +2,14 @@ You can use a **template** to give your page a style. The template will use **HyperText Markup Language (HTML)**. - --- task --- + Go to your terminal and press Ctrl + C to stop your flask server. + --- /task --- --- task --- + Create a `templates` directory in your `webapp` directory: --- code --- @@ -16,6 +18,7 @@ language: bash line_numbers: false --- mkdir templates + --- /code --- --- /task --- @@ -27,6 +30,7 @@ Go back to **Thonny** and create a new file. Save this file as `index.html` insi --- /task --- --- task --- + Add this code to `index.html` and **save** your changes. --- code --- @@ -39,6 +43,7 @@ line_numbers: true