Fullstack Python Web Development with Flask, Jinja (Frontend), and SQL Database
A three-hour seminar I co-authored with Jamel Eddine Jridi for IFT3225 – Technologie de l’Internet, in which we build a small blog with Flask, Jinja templates and an SQLite database.
- Type
- Seminar
- Duration
- 3h - 1 bloc/sitting
- Co-author
- Jamel Eddine Jridi
- Course
- IFT3225 – Technologie de l’Internet
- Technologies
- Python, Flask, Jinja, Werkzeug, SQLite
- Materials
- 2 slide decks (PDF): theory and code
- Language
- French
What the seminar covers
The theory part explains where Flask comes from (it began as a thin layer over Werkzeug and Jinja), how this Python web framework works, why its built-in routing is an asset for such a light library, which important web tasks require extensions, and how it compares with its competitors.
Building the blog
The code part assembles a complete blog application step by step:
- an MVC structure, keeping in mind that Flask does not impose one
- the base application: imports, the Flask instance, configuration and routes that handle GET and POST
- Jinja templates that extend a shared layout and display flashed messages
- a data layer written in plain SQL on SQLite and handled at each CRUD step, with a note on why an ORM is usually preferable
- a simple project structure, then the final run with flask run
Front-end options
Views are written in classic HTML and CSS with Jinja, but the slides also show that the same Python back end can serve a React front end instead.