Learn Flask in a scientific way
Since I started working as a faculty two years ago, I spent more time writing papers than code. For a research project that I started a few months ago, my students and I had to pick a framework that can support fast prototyping and can also be learned given a month or two. Eventually, we picked Flask, spent time learning it, and used it to develop our intended product. The project is still ongoing and moving on smoothly.
Same as others, when I had to learn Flask, I went over a set of different tutorials other developers put online, and read a couple of books. The qualities of tutorials and books vary. Most tutorials carry a lot of assumptions about their readers but never laid those assumptions out clearly. Many tutorials presented too much information in a very short time, which is likely to overload learners cognitively. It takes a lot for learners, especially the novices, to overcome all these barriers to achieve effective learning. Reflecting on my still fresh learning experience, I want to write a series of tutorials that cover learning Flask in a more task-oriented and learner-centered way.
We are going to develop a web application that allows scientists to post mean reviews they received for their papers, and check all mean reviews posted by other scientists.
This can potentially be a good venue to release the pressure they gain from academic life. The end product may look like this:
Assumptions about learners
- Have some exposure to programming in Python.
- Have some knowledge of object-oriented programming.
- Know a little bit about Git.
- Have some knowledge of HTML and CSS.
- Have some knowledge of the basic structure of a Flask web application, and what “requests” and “responses” are in Flask. (Covered in Build and Test a Mini Flask Application.)
Source code and demo
- The source code of this tutorial can be accessed on GitHub.
- The demo application can be accessed at https://pacific-fortress-91193.herokuapp.com/.
- Build and test a mini Flask application
- Build, Test, and Deploy a Flask Application: Part 1 — Templates
- Build, Test, and Deploy a Flask Application: Part 2 — Authentication
- Build, Test, and Deploy a Flask Application: Part 3 — Application Factory and Blueprints
- Build, Test, and Deploy a Flask Application: Part 4 — Restructuring Testing
- Build, Test, and Deploy a Flask Application: Part 5 — Authentication (continued)
- Build, Test, and Deploy a Flask Application: Part 6 — Review System
- Build, Test, and Deploy a Flask Application: Part 7 — Deployment