Block 61: Flask: Getting Started
Build and run your first Flask web application.
Concepts
- pip install flask
- Flask app structure: app.py
- app.route() decorator
- debug=True for development
- Returning strings and HTML
Code Examples
See exercise below.
Exercise
Create a Flask app with routes: /, /hello/<name>, /about. Test in browser. Return a JSON response from a /data route.
Homework
What does debug=True do? Why should it NEVER be used in production?