17 - Django Templates Basics - Python & Django 3.2 Tutorial Series
HTML-код
- Опубликовано: 9 фев 2025
- 17 - Django Templates Basics - Python & Django 3.2 Tutorial Series
Try Django 3.2 is a series to teach you the fundamentals of creating web applications with Python & Django by building a real project step-by-step.
⦿ Playlist: • Try Django 3.2 - Pytho...
⦿ DigitalOcean $100 Promo: do.co/cfe-youtube
⦿ Code: github.com/cod...
⦿ Subscribe: cfe.sh/youtube
⦿ Setup Video for Python 3 & Django 3: • Install & Setup Python...
this is literally the best Django series available on the whole youtube!
I have a sentence for you and which is. You know how Django works. You are not the kind of Looser who just pit his bull whenever they see opposite one's. But you worked hard with Django and Excelled it. Great Guy to experience in this world. keep going Best of Luck.
This one was actually the best video explaining django templates!! well done!
Oh man, this is gold! Thank you so much.
istg i learn something new about formatting strings in python every day!
One of the best. Thanks a lot
Thanks!
thanks
great video!
At 6:55, why did you do context = context when it works with only passing context dictionary as the argument. What is the first context in the parameter?
great!
🎉🎉🎉🎉 hi bro
My VS Code doesn't seem to do anything with HTML (such as automatically adding the etc tags)...what extension are you using? I tried a few but none of them function that way.
Hello.Thanks for great tutorial.I am trying to finish your tutorial.Can u share shortcuts for make easy coding
For yt algo 👌
hi why my error message only appear on terminal, but not on the website page like yours? like on minute 11.06 the message templetedoesnotexist do appear on my vscode terminal but on the website it unable to connect server smthing
Set debug=True in settings.py
video 17, 16:10, why we only call object once: object.title, but for id and content, we don't add object. to the variables?
Since we already defined what the 'title', 'id' and 'content' keys are in the context dictionary, we can just use 'title'.
When he used object.title, he's basically showing another way to call the object's title. He defined what 'object' is in the context dictionary, then got the title from the 'object' key directly instead of using the 'title' key.
feedback show the correct way first
agree, the 1st shown way got me an error. Fixed after adding BASE_DIR
add r before the path on settings.py dirs
thanks you're a lifesaver
@@heterotrophic yooo i actually helped someone
@@eladoh5855 FR TYSM
I had to turn the slashes around for my path string in windows
BASE_DIR / "templates",
TypeError: unsupported operand type(s) for /: 'str' and 'str'
how to fix this?
Make sure your base_dir is defined with pathlib
Food for thought but not many students withstand being told everything that doesn't work before you bring what it does. It is sufficient to comment it out but a total overkill to demo all the wrong approaches to a problem.
I have seen several Django books and videos but this is totally different and I think confusing. I know about the Model, Template and View in Django , and also configuring Urls to the view. But here, I'm seeing an entirely different procedure and doesn't seem easy.
Well I think here he shows different methods on how to do it step by step. If later on you use TemplateView class, you won't need any of that, as everything is handled under the hood. But here you actually see what steps are needed/done for you and I think is great for understanding.
imp *
Question: why would I get an error when i have BASE_DIR / 'templates'. Below is the error I get.
: C:\Users\bg197\Documents\Django\templates\home.html (Source does not exist)
I recognize why the error is there because it should be C:\Users\bg197\Documents\Django\DRS\templates\home.html. If I set the value to be:BASE_DIR / 'DRS/templates'
Then it works.
But when you do it, you are not setting the project folder name, just templates.
My setting.py BASE_DIR is set to:
BASE_DIR = Path(__file__).resolve().parent.parent
Thank you.
Thanks!