Category: Django

0

Django Syntax

Django Syntax — meaning the most important pieces of Python + Django-specific syntax that you will write 1000 times in every project. I’m not going to give you a boring list of rules. Instead,...

0

Chapter 1: Django Template Variables

Template variables — that is: everything that happens between {{ and }} Most beginners think “it’s just printing a variable”… but there is a whole little language inside those double curly braces. Understanding it...

0

Chapter 2: Django Template Tags

Template tags — everything that lives inside {% %} Many people learn {{ variable }} first and think “okay I can print stuff”, but real Django power comes from the tags. They control logic,...

0

Chapter 3: Django if Tag

Django if Tag: The {% if %} tag family ({% if %}, {% elif %}, {% else %}, {% endif %}) Many beginners treat it like “just Python if”, but it’s actually a very...

0

Chapter 4: Django for Tag

for Tag: {% for %} — the loop tag. This tag appears in almost every real template you will ever write. Many beginners write it once or twice, see it “kind of works”, and...

0

Chapter 5: Django comment Tag

comment Tag: {% comment %} and its friends — the proper way to write comments inside templates. Many beginners either: use HTML comments <!– –> (which appear in source code — bad for security...

0

Chapter 6: Django include Tag

 include Tag: The {% include %} tag Many beginners either: copy-paste the same HTML block (navbar, footer, question card, pagination, alert messages…) into 5–10 different templates → nightmare when you want to change one...

0

QuerySets

QuerySets: (the thing you get when you write Question.objects.all(), filter(), order_by(), etc.) Most beginners treat QuerySets like “just a list of objects” — but they are much smarter, lazy, chainable, SQL-optimizing magic objects. Understanding them...

0

Chapter 1: QuerySet Introduction

QuerySet Introduction QuerySets — the thing you get when you write Question.objects.all(), .filter(), .order_by(), etc. Most beginners treat QuerySets like “just a list of objects” — they loop over them, slice them, print them,...

0

Chapter 2: Django QuerySet – Get Data

QuerySet – Get Data: How to actually GET data from the database using QuerySets In other words: “How do I turn my Question and Choice models into real, useful data that I can show...