Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Projects/websites/flask_calculator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Flask we will use for building the actual website. Requests we will use for debu

### Step 1 - Home Page

Create a file called `calaculator.py`. It's opening contents should contain:
Create a file called `calculator.py`. It's opening contents should contain:

```python
from flask import Flask
Expand Down Expand Up @@ -193,11 +193,11 @@ file called `html-add.html`. In that file write the following:
```

This may look a little weird to others who have done html before. But we're
actually going t use a special "templating syntax" in Flask so it can do
actually going to use a special "templating syntax" in Flask so it can do
some things for us. The `{{ result }}` line for example, will be replaced by
a variable we give called `result`.

To do this write the following function in you `calculator.py`:
To do this write the following function in your `calculator.py`:

```python
from flask import Flask, render_template
Expand All @@ -209,7 +209,7 @@ def add_html(num1, num2):
return render_template('html-add.html', num1=num1, num2=num2, result=num1 + num2)
```

Now restart the ap and in your browser go to `localhost:5000/number-html/4`
Now restart the app and in your browser go to `localhost:5000/number-html/4`

You now have a slightly styled web page!

Expand Down Expand Up @@ -255,7 +255,7 @@ def add_post():
```

Rerun the application, but instead of going to the browser this time,
open up IDLE or a python terminal and run the following:
open up a REPR or a python terminal and run the following:

```pythonstub
>>> import requests
Expand Down Expand Up @@ -334,4 +334,4 @@ If you created POST routes for other operators, e.g. subtract, divide etc. You
can use this same template for those routes. You just need to change the forms
action.

If you can think of how you could do all of these in a single route.
If you can think of how you could do all of these in a single route.