Guys, be careful, in Python3 is a little different. for example: {% load static from staticfiles%} becomes {% load static%} Small differences that can drive you crazy. However fantastic tutorial
@unabonger7774 жыл бұрын
I think you mean Django 3
@Anom214 жыл бұрын
yeah I learned it the hard way lol
@mudassiransari85193 жыл бұрын
Thank you, bro!
@mysskingopi61433 жыл бұрын
This block content was not work in Python 3 what to do?
@fireberrywocky5 жыл бұрын
Omw!! Literally, thank God for you!! I was ready to cry before I stumbled on your page! I felt so dumb before! Maybe other people were just giving dumb explanations, cause everything seems so much easier now!
@NetNinja5 жыл бұрын
Awesome, glad you liked :)
@-r0l1n953 жыл бұрын
THANK YOU! I have been confused about this topic all day trying to find videos explaining it but your video cleared it all up for me thanks!
@aakashjha7087 жыл бұрын
As always, short, precise and well explained !
@JollyAZ4 жыл бұрын
It is criminal this only has 37k views. Idk how u could have made this any easier to understand
@setkyarwalar7 жыл бұрын
Thanks. I decide to work on my personal project with Django, after I watch your tutorials. Keep up the good work :)
@CAONST_DEV2 жыл бұрын
this version Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. {% load static %} and layout.html in from app/templates , This is Ok?
@tz73834 жыл бұрын
Hi, nice video! I was wondering how could you perform 'template extends' in two steps? extend template 1 into template 2, followed by extend template 2 into template 3??
@mrvanhoyte Жыл бұрын
Question, how would you add tags to the head from the template because I tried and like my base description keeps over riding my template tags or it keeps taking the image on my nav and ignoring what I set as the image
@funwithpython8833 жыл бұрын
Thanks man, you saved me, keep up the good job.
@panagiotisgoulas85394 жыл бұрын
Hey I have a question. How do I do partial template inheritance? My problem is I have a base template that many of my templates inherit from and it has a container with 2 columns, col-md-8 and col-md-4. On the col-md-8 column part of the container is where the {% block content %} lives and on the other one the col-md-4 is my sidebar. Now when I use my registration form since it inherits from base template I have a col-md-8 form but I don't want to see sidebar when I register... Anyone any ideas?
@Kristmaz8086 жыл бұрын
this concept just blew my mind....
@linkymcfinkelstein67634 жыл бұрын
This was exactly what I was looking for! Thank you for saving my time, next time I subscribe.
@prasadkadu97375 жыл бұрын
i cant get my backgroung image from styles.css file ??
@nikhilkumar54124 жыл бұрын
How do I change the title of other html files since is present in the base_layout. Html??
@elyasomarr4 жыл бұрын
That's great but I have a question how should we fix the title tag as they will not be same for every template?
@elyasomarr4 жыл бұрын
Founf it from stackoverflow Django display a page title based on a variable stored in a view Views.py def sport_landing(request): page_title = 'Sport' cat_landing = Article.objects.filter(status='published', category='sport', published_date__lte=timezone.now() ).order_by('-published_date') return render(request, "categorylanding.html", {'cat_landing': cat_landing, 'page_title':page_title } Template {% extends 'base.html' %} {% load humanize %} {% block content %} {{ page_title }}
@kouyajia4967 жыл бұрын
Hello Ninja, will you show us how to deploy the website using mod-wsgi? Really looking forward, thanks.
@zarakikenpachi12384 жыл бұрын
Thank you a lot :) Did you think that learing python django, are good idea :) because i see, that c++ and is the most searching langage ? if you could help me
@altair66166 жыл бұрын
can i have more than 1 block content in the base layout and how tho manage them if i can ?
@hamamathivha60556 жыл бұрын
You're an awesome teacher bro : )
@algoholic-pro5 жыл бұрын
Thank you,It was a much required concept
@brickandorder6 жыл бұрын
I'm kinda frustrated here.. I have some code for extends from 'blog/header'' {% extends 'blog/header.html' %} {% block content %} Hey, welcome to my website! I am a programmer. (% endblock %} That is the home.html file. I get an error that reads from the development site: Unclosed tag on line 3: 'block'. Looking for one of: endblock. Specifically this is an error during rendering. I don't have any guess to what could be wrong with my render processing for this.
I am running into an error when trying to run with this extension, {% extends 'base_layout.html' %} Error during template rendering. Going through the stack trace it appears it cannot find the layout. I am confident everything is correctly placed and correctly named...
@guywithwings20026 жыл бұрын
Hey so at this point you probably moved on, but I had a similar issue and after looking into the settings.py file realized that i forgot to set 'templates' as a DIRS (which is necessary in telling Django that the templates folder exists). change "DIRS: []," to "DIRS: ['templates'],". Sorry for being late on ball!
@saipavanmeruga7095 жыл бұрын
@@guywithwings2002 Hey can you help with the template not found error I have added the code "DIRS: ['templates']" still the error exists i dont know why
@harshitjain76735 жыл бұрын
@@saipavanmeruga709 Instead of that make it 'DIRS': [ os.path.join(BASE_DIR, 'templates'), ], this worked for me
@manuelamolong84682 жыл бұрын
very helpful 👍
@SMA5HPL7 жыл бұрын
how do you remove the tabs(spaces) before the selected text? :D
@NetNinja7 жыл бұрын
:D. In Atom, you highlight the block of code and press shift + tab. It removes the indent of that block. But only when it's a multi-line block. If you highlight just one line of code and try it... poof. Goodbye line of code.
@AboSara202056 жыл бұрын
Thanks, that was very helpful
@sirajAlam0496 жыл бұрын
Awesome. Subscribed!!
@vishavbangotra54054 жыл бұрын
How to extend multiple templates in one?
@yjk227 жыл бұрын
How to create realtime chatting system like socket.io using Django?
@REZAsys24 жыл бұрын
Thanks but there is not code in github
@Standupibrahimbackup4 жыл бұрын
Bro it might sound very random but are you MrFreeze2244 who made hitman game walkthrough videos?
@NetNinja4 жыл бұрын
Hey no, not me 🙂
@viswanadhgounipalli28896 жыл бұрын
thank you so much and very help full to me
@Lbmaniak6 жыл бұрын
thx I hope, someday I will watch playlist for Django in production :-)
@jamessanders5522 Жыл бұрын
Fantastic tutorial videos, clear and concise explanations on even the tiniest of things 🤝🫶
@NetNinja Жыл бұрын
Much appreciated! :) thanks for watching
@C137-RickSanchez3 жыл бұрын
thank you sir, i read the docs but i cant understand until watch your video
@KevinTempelx4 жыл бұрын
Thank you!
@blacksoliderfly6 жыл бұрын
u are amazing
@TKDVL5 жыл бұрын
The stof hahaha, love that british accent
@learnanywhere57367 жыл бұрын
hi bro i already well know in django i want to know signal listview Templateview formview registration user login and logout upload picture video kindly make tutor following this type of video..
@NetNinja7 жыл бұрын
Hey, user registration is coming soon - sign up, login, logout etc - as well as how to upload media :)
@i_am_a_real_cat14433 жыл бұрын
finally i got it
@Sheetanshkumar5 жыл бұрын
well, you saved me :D
@codejns22756 жыл бұрын
Extend the template but render the new template. Anybody following step by step : do remember to render the new template not the base template.
@Anom214 жыл бұрын
I love to eliminate code duplication
@sabyasachisamantaray902 жыл бұрын
Reason Unknown to me: If your block contents ain't working Try renaming the base_layout.html to base.html This worked for me. Would be thankful if anyone explains me the reason
@Govt_Jobb4 жыл бұрын
It shows me error (TemplateDoesNotExist at /) Edit: Thank you so much sir, it's worked for me. Liked.
@bountyhunter81324 жыл бұрын
How exactly did you fix the template does not exist problem? I dont know how. Thanks. :)
@Govt_Jobb4 жыл бұрын
@@bountyhunter8132 Actually i was trying to extend a base file, and because of wrong path, it show *(TemplateDoesNotExist at /)* this error. Wrong path: {% extends 'base.html' %} Correct path: {% extends 'blog/base.html' %} You can check if there is any name error.
@bountyhunter81324 жыл бұрын
@@Govt_Jobb Sorry i found out like five min after asking you. I wonder how he did it because his was in the main templates file. I had to put it in the articles template.