Answers for "flask syntax"

13

simple flask app

# Extremely simple flask application, will display 'Hello World!' on the screen when you run it
# Access it by running it, then going to whatever port its running on (It'll say which port it's running on).
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

if __name__ == '__main__':
    app.run()
Posted by: Guest on July-31-2020
3

flask example

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
Posted by: Guest on June-11-2020
5

flask site route

from flask import render_template

@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
    return render_template('hello.html', name=name)
  
---------------------------------------------------
<!doctype html>
<title>Hello from Flask</title>
{% if name %}
  <h1>Hello {{ name }}!</h1>
{% else %}
  <h1>Hello, World!</h1>
{% endif %}
Posted by: Guest on May-26-2020
3

what is flask

These are by far the best Flask tutorials there are: https://youtube.com/playlist?list=PLzMcBGfZo4-n4vJJybUVV3Un_NFS5EOgX
Posted by: Guest on April-06-2021
2

what is flask

Flask is a web framework written in Python. 
This means flask provides you with tools, libraries and technologies that allow you to build a web application.

Here a a few resources for learning Flask (I have not personally used them before):
	https://youtube.com/playlist?list=PLzMcBGfZo4-n4vJJybUVV3Un_NFS5EOgX
    https://realpython.com/tutorials/flask/
    https://opensource.com/article/18/4/flask
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language