Templates Inheritance getting better

Post #285 written by Khodok in Code Sanity and Optimization Updates


Templates Inheritance

If you don’t know what it is well, it’s a thing in Django that allows developers to make stuff DRY (Don’t Repeat Yourself) by making a snippet of code once and using it everywhere else using templates inheritance, I use it everywhere and it’s a life saver of course, but for some reason (I really don’t know why ngl) I couldn’t use it the way I’m using it right now with posts, so either I was doing something wrong, or I didn’t notice I was already using it that way (because my templates are well organized… but I have hundreds, so I happen to get lost in them from time to time. although it’s rare, there’s still a few things that I rediscover when I make changes.

What’s new

  • Nothing much

What changed

  • My code base is slowly getting easier to travel through, I will apply this to most things on my website. And since I had to great idea to keep most things looking pretty much the same everywhere, it shouldn’t take long, or rather it will take an excruciating amount of time, but it won’t be hard to do.

Btw this is part of the huge refactoring that I’ve been doing for some time now, I started most things badly, now I’m trying to fix shit so it gets better, but there’s months of bad work behind this (I was a big newbie), and I believe it’s important that I fix things too (not only add stuff), else I get lost in my code and I don’t enjoy updating stuff anymore.


Please Log in to leave a comment.

No comments yet.