Skip to main content

A Hundred Days of Code, Day 045

Follow my whole plodding journey here.

Wrote a basic login form today.
Short story short, it shows up, but it does not respond like Miguel shows in the course. It justs sits there … staring back at me … like an obstinate goat.

Will go spelunking into what I could have done wrong, tomorrow.

Learnt about adding routes and creating views and making templates.
Thoroughly confused though.
While I am dumbly following instructions right now, what I don’t get, is what do I need to write first? It all seems very circular to me.
What comes first? The route, the form, the template, the chicken or the egg?

Hopefully, I will gain clarity as I progress.


Orwell’s 1984

If you want a picture of the future, imagine a boot stamping on a human face … forever.

That, probably is the quotable line, I found.

The book’s terrible, and I hated the story (too bleak, too dystopian).
The only reason for its popularity is that events in real life, are proving Orwell right.

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 

Butterick’s Practical Typography

In my youth, I came across the work of Robin Williams.
No, not that one.

She introduced me to the beauty of CRAP.
And the fact that the PC is not a typewriter.
But most of all, she introducted me to the beauty of type and design

Fonts, and line spacing and kerning and everything else lovely, about the written word.

And now if you want all that wisdom distilled, into a short, opinionated, beautiful web series, look no further than Matthew Butterick’s, Practical Typography.

The content is freely given, and the book is reader supported

What is typography?
What is type composition?
How do you format text?
Are there two spaces after a line? Or one?
What are the best fonts to use, instead of tired old Times New Roman?
How do you layout your page for a letterhead? a research document? a presentation? a résumé?
And why in God’s name, does typography even matter? Isn’t print dead?

Answers to these, and many more questions in the book.
If you want your prose to look polished, you owe it to yourself to read it.


A Hundred Days of Code, Day 043

Continuing with the Flask course.

Today I learnt about how to loop, using Jinja loop blocks.
The syntax is slowly becoming clear to me.
Everything python related in enclosed is {% … %} blocks, except for variables which use their own {{ … }} syntax.

What I am still confused on is the relationship between the various files, I am writing. There is html and then there are templates and there are python files themselves. Hopefully that will get clearer in the days to come.
My naïve understanding, right now, is

  1. Some native python code is mainly for launching and running the app.
  2. The html templates pull data from …
  3. The flask python code I write (the routes file, as of now).

I also learnt how to extend templates. I created a base template that basically contains the header and the title, which will now be used by every new webpage I build. Right now, it’s just the home page.
I can see a footer or header or some such persistent element that needs to be on every page, that can be created once and then extended multiple times.

More, tomorrow …

P.S. Looking at that finished app, and knowing my extremely rudimentary Python skills, I feel like an apprentice mason, hammer and a chisel in hand, wondering, how in heck, am I going to carve David?


The Picture of Dorian Gray

Word for word, the most epigramatic book I have read.
Short, sweet and beautiful words and lines and dialogue.

Here’s a few.

The books that the world calls immoral are books that show the world its own shame.


Experience is merely the name men gave to their mistakes.


Nowadays people know the price of everything and the value of nothing.


Children begin by loving their parents; as they grow older they judge them; sometimes they forgive them.


Nothing can cure the soul but the senses, just as nothing can cure the senses but the soul.


There is no such thing as a moral or an immoral book.


Books are well written, or badly written. That is all.


Man is many things, but he is not rational.


People are very fond of giving away what they need most themselves. It is what I call the depth of generosity.


We can have in life but one great experience at best, and the secret of life is to reproduce that experience as often as possible.


We live in an age that reads too much to be wise, and that thinks too much to be beautiful.