On the web with Python and Flask (1)

Let’s start using Flask to make a server and start our first web page with Python and this module. It is very easy. Here is the code and the video that will demonstrate it’s easy use.

# Using Flask lesson 1

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
	return "Homepage with Python, our first attempt to make a web page with Flask"

app.run(debug=True)

 

 

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.