DEV Community

Sai Sakthi
Sai Sakthi

Posted on

A Slash That Destroyed My EGO in Programming

CodeNewbie Story

What were you building, and why?

So I am a kind of new dev at that time. I was learning Python at the time with Django. I was not so involved in programming at that time and just doing it for fun. One such project was Blog Website of Mine. It was a small project in Django

GitHub logo SaisakthiM / Infrastructure-Project

This is my Infrastructure project where all the projects are bundled as a terraform infrastructure enviroinments and orchestrated but terragrunt

⬑ Infrastructure-Project

A self-hosted homelab that runs the applications I've built over the last few years.

Release License Go Terraform ArgoCD



Table of Contents

πŸ— Architecture and Stack

                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚       Nginx Gateway  :80 / :443       β”‚
                        β”‚   Let's Encrypt SSL β€” Single Entry     β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                                   β”‚                               β”‚
 β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
 β”‚  /notes/   β”‚                    β”‚   /bank/     β”‚               β”‚   /quiz/      β”‚
 β”‚  Django    β”‚                    β”‚ Spring Boot  β”‚               β”‚ React static  β”‚
 β”‚ PostgreSQL β”‚                    β”‚ PostgreSQL   β”‚               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚  /video/   β”‚                    β”‚  /hospital/  β”‚               β”‚   /blog/     β”‚
 β”‚  Node.js   β”‚                    β”‚   Django     β”‚               β”‚   Django     β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚   SQLite     β”‚               β”‚ MySQL+MinIO  β”‚
                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚/api-serviceβ”‚                    β”‚  /document/  β”‚               β”‚  /whisper/   β”‚
 β”‚  Node.js   β”‚                    β”‚   Django     β”‚               β”‚  Rust+Axum   β”‚
 β”‚  Express   β”‚                    β”‚ MySQL+MinIO  β”‚               β”‚
…



Now it has changed a lot but here was the core idea.

1) Go to register if new, and login if aldready have a account. Login

2) Publish a post, A simple home page where all the post lies

3) Inside the post, there are things we can comment and also upload

That's all really was there to that project. I completed all the work, Created Models for Posts Comments migrated to the DB and it started running

What did you expect to happen?

I thought when it ran and showed that 8080 port, I thought to myself that ok, well all runs good, I should be seeing a Register Page when I go to 8080 port

The moment you realized something was off

So when I gone there, Wow, I was hit with beautiful
"Template not found Error"
I was geniunly confused actually because I clearly followed all the tutorials and documentation. It clearly told to place it in templates folder and I did exactly that. But why do I get a "Template not Found Error" then

Everything you tried (including what didn't work)

First I suspected that I placed it in wrong folder. So this time, I again copied out the templates/blog to just templates/ and well it did not work

Then this time, I placed it in root of the Django and still did not work
Ok this time let's place it near settings.py atleast then it would resolve

Still did not work at all.
Hours passed and even days passed, I was so confused that I don't know what I was doing.
Then finally decided to look into the templates itself.
Ok here also fine, home is good and even the layout is good.
This time, when I was coding, Chat GPT was new to the scene and wasn't much smarter like today.
But I still asked what's the error and also pasted the code. It spitted out some of it's code and well again did not work.

Checked all the files for days except the culprit.
The base.html . I used {% extends '.base.html' %} in the layout. Well Chat GPT did not catch that at the time.

A SINGLE SHASH , LIKE
{% extends './base.html' %}

Would have fixed the error in a instant. But what I got was a trauma that I still remember to this day

Where things stand now

It's been years since that error. That error triggered something inside me. Now I am not working but studying in college and doing projects and contributing to OSS in free time. But that single slash taught me what 100 tutorials did not teach. The bugs are in the simplest of places

Anything else you want our guests to weigh in on?

If you get a error say 500 requests for a upload request (I actually got that in my project), Don't go roaming around entire chuncks of code and looking around. Find what function it is and other functions that it uses. Around in first - second degree search, you will find most of the errors. That's how I solved it and I will be always grateful for that error which taught me to break down and crack down instead of just chugging down the code and hoping to fix

Top comments (0)