Skip to content

Instantly share code, notes, and snippets.

@kezzico
Last active October 20, 2023 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kezzico/3f01814278d1fedd6e4103676377ca47 to your computer and use it in GitHub Desktop.
Save kezzico/3f01814278d1fedd6e4103676377ca47 to your computer and use it in GitHub Desktop.
PYTHON: Flask Application Template

Flask Application Template

Python's application server Flask is convenient for serving HTTP content from a Python application.

Here's a 'Hello World' example to get started

Required reading:

Install flask in virtual environment

pip install flask

Create a main.py containing this.

from flask import Flask
app = Flask(__name__)

@app.route("/")
def index():
    return "<h1>Hello World!</h1>"

if __name__ == "__main__":
    app.run(host='0.0.0.0',port=5051)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment