Examples
A few examples on various things you will need to do with Flask.
Example Template Repo
Throughout this example page, I base a lot of the examples on the following repo. Please clone or download the example as a base starting point when I mention the use of that repo.
Simple Example From Flask Docs:
If you go to the Flask docs you will see a very simple example to quickly teach you the simple concepts and I have that listed below. I would recommend taking a look at the Better Simple Example afterward. I got the idea for this better example from The Flask Mega Tutorial.
Create a new file called app.py
, paste the following code, and then inside your terminal run python app.py
.
Don't forget to be inside your virtual environment. Learn more
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == "__main__":
app.run(debug=True)
Better Simple Example:
Coming soon...
Last updated
Was this helpful?