Skip to main content

A Hundred Days of Code, Day 044

Continuing the Flask course.

Learnt about seperation of concerns today.
To me that means that I should try to keep related things together and disparate stuff apart.
Case in point, we1 created a seperate file config.py to store the variables about the program in. And then to kind of secure it even more, instead of hardcoding the password in the file, it now looks for an environment variable, which I need to set before running the program.
Another example was when we created a seperate file to process input (for our logins) and then put all the login, password etc. fields in there. This feels good. Feels like I am learning best practices and good habits already.

The file I created to process login input, is called a form (as in fill in this form? guess so) and uses the WTForms package to do the heavy lifting.
And that was where I learnt my next bit. Not only is Flask, made of modular pieces, it also has an ecosystem of various other modules (called flask extensions) that give it extra functionality, oomph and power.2

And here’s where I called it a day.


  1. Who we? Why, Miguel the instructor and me, of course XD 

  2. WTForms is an example