Jul 11, 2024
virtualenv
package: pip install virtualenv
brew install virtualenv
virtualenv <env_name> <python_version(optional)>
source <env_directory>/bin/activate
pip install flask
pip freeze
import flask
app.py
from flask import Flask
app = Flask(__name__)
Flask
__name__
is typically the correct value for the application instance constructorapp.route
decorator:
@app.route('/')
def index():
return 'Hello, World!'
/
)