Kurse › Raspberry Pi › Stufe 17
Raspberry Pi · Intermediate · Stufe 17 / 40
Web Apps with Flask and SQLite
Build a database-backed web dashboard and API that shows sensor data and controls hardware.
Intermediate freischalten · CHF 19.90 Stufen 14–26, einmalig, kein Abo
10 Lektionen in dieser Stufe
- HTTP Requests, Responses and Status Codes
Describe what a browser and a server exchange. · Lab: Inspect requests with curl -v and the browser's network tab against a public site. - A Minimal Flask App with Routes
Serve pages and dynamic values from Python. · Lab: Create a Flask app with a home page and a /temperature route. - HTML Templates with Jinja
Separate page layout from Python logic with templates and inheritance. · Lab: Build a base template and two pages that extend it with live values. - Switching GPIO Outputs from a Web Page
Trigger hardware actions safely from HTTP requests. · Lab: Add buttons that turn an LED or relay on and off using POST requests. - Forms, Validation and Login Sessions
Accept user input safely and restrict pages to logged-in users. · Lab: Add a settings form with validated limits and a login page with a hashed password. - Designing a JSON API for Sensor Data
Expose readings and commands as clean, versioned endpoints. · Lab: Add /api/v1/readings and /api/v1/outputs and call them with curl. - Designing a SQLite Schema for Time-Series Readings
Model sensors and readings with types, keys and indexes. · Lab: Create tables, insert readings from the logger and inspect them with the sqlite3 shell. - Querying and Aggregating with SQL
Select, filter, group and average readings by time. · Lab: Write queries for the last hour, daily min and max, and a missing-data check. - Live Charts in the Browser
Fetch JSON with JavaScript and draw an updating chart. · Lab: Add a line chart that refreshes every ten seconds from the API. - Serving Flask in Production with gunicorn and nginx
Replace the development server with a robust, service-managed stack. · Lab: Run the app under gunicorn as a systemd unit and put nginx in front as a reverse proxy.
Abschlussprojekt
A password-protected web dashboard served by gunicorn behind nginx that stores readings in SQLite, charts them live and switches an output from the browser.
Teile für diese Stufe
- 1 × Raspberry Pi 5 or Pi 4 set from Level 1
- 1 × Sensor node hardware from Level 11
- 1 × LED and relay module from earlier levels
In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Raspberry Pi →
Voraussetzung: Levels 11, 15 and 16: sensor reading, systemd services and Git.