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.