▶️ Watch Entire Django Blog Playlist ✅ Subscribe To My KZbin Channel: bit.ly/3bWN6wj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
@steelydan20224 жыл бұрын
This tutorial series is fantastic! I hope you are being fairly compensated. Thanks so much!
@Codemycom4 жыл бұрын
Glad you like them!
@andrenevares75434 жыл бұрын
The best explanation of class base views of all KZbin Channels. Nice Work. I use Django for a while. But watching your videos help me to see some points in another way. Thanks.
@Codemycom4 жыл бұрын
Glad it was helpful!
@ninjatribble79614 жыл бұрын
Your channel is keeping me busy during lockdown, keep em coming!
@Codemycom4 жыл бұрын
Happy to help!
@fatimas64283 жыл бұрын
Wow!!!! Just Wow.. This video is all i needed.. i was stuck on how to link each title with their respective details and boom! This just solved that so easily!! 🤩🤩🤩🤩
@Codemycom3 жыл бұрын
Glad you liked it!
@nowyouknow22494 жыл бұрын
This channel is underrated. Thanks John Elder!
@Codemycom4 жыл бұрын
I agree, tell your friends about it! :-p
@exactbrain62484 жыл бұрын
youve helped me alot man,at first i never want to watch your video not until one click,and booom i am addicted to your videos
@Codemycom4 жыл бұрын
Great!
@Kier-cw6qc4 жыл бұрын
The way you teach is so stress free. hahaha you're releasing good vibes. hahaha Thank Your very much .
@Codemycom4 жыл бұрын
Happy to hear that!
@DwijeshDookraz4 жыл бұрын
Hey, John, I got to 16:18 and had the link to the other page up but when I tried to do any of the {{post.title}} stuff it would just print {{post.title}} on the second page and not the actual title like it did on the first page.
@Codemycom4 жыл бұрын
that's weird... what are you doing differently than the video?
@kabahblog4 жыл бұрын
put {% object.title %}
@singhshubham7654 жыл бұрын
@@kabahblog work for me {{ object.Title }}
@tudorcozma67813 жыл бұрын
Thank you very much for this lesson for a week I'm watching different lessons to find how to put different lists of items on the same page listView Maybe I found something, but i didn't understoond that, You explaned so simple clear.
@Codemycom3 жыл бұрын
Glad you liked it
@monstersav75464 жыл бұрын
Man I just like your "What's going on guys...". Thank you very much sir. I wish you just Live and Code Forever. Love your work sir.
@Codemycom4 жыл бұрын
I appreciate that!
@habiborrahaman45313 жыл бұрын
raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) how to solve this issue
@adelbordbari94164 жыл бұрын
it's 4:12am but I'm stuck! I can't stop watching these.
@Codemycom4 жыл бұрын
Awesome! I know the feeling
@kindaworks32932 жыл бұрын
best tut ever made on KZbin! Liked and Subbed, you are the best!
@Codemycom2 жыл бұрын
Thanks! Appreciate it!
@cyberlab5512 жыл бұрын
you're the best. you save me after three hours of facing bugs. do you want to know something? you're my favorite youtuber and programmer
@dav1d_andrew3 жыл бұрын
your style is perfect for a fast learner. Thank you bro🤙
@Codemycom3 жыл бұрын
Glad you think so!
@yao89783 жыл бұрын
Your django course is cool! Thanks!
@Codemycom3 жыл бұрын
Glad you like it!
@fzahmd54614 жыл бұрын
Well Explained sir, Thanks for sharing.
@Codemycom4 жыл бұрын
Thanks for watching!
@pandurangasharmaramaka2 жыл бұрын
Thank you. Worked out. you're a great teacher, no doubt.
@Codemycom2 жыл бұрын
Glad you got it worked out
@abdullahatif78544 жыл бұрын
Yes, this is pretty simple so far. Thanks Mr.J Hehehe
@Codemycom4 жыл бұрын
You're welcome
@MrShadowblue252 жыл бұрын
Great, So far, this is really the tutorial I was looking for...and I watched a few lol. thx
@john-mikecourteaud97724 жыл бұрын
Thank you very much for the videos. The concepts are well explained and we're going step by step with the functionalities. Hi from Reunion island.
@Codemycom4 жыл бұрын
Thanks! Glad you enjoyed them!
@delvorin18414 жыл бұрын
Thanks, John for posting the video/series.
@Codemycom4 жыл бұрын
You're welcome! :-)
@jiffylab2 жыл бұрын
Hi, after 8:47, I ran my code and got an error: Exception Type: TemplateDoesNotExist Exception Value: blog/post_list.html Any suggestions on how to fix this?
@Codemycom2 жыл бұрын
It's telling you what's wrong. It can't find a template at blog/post_list.html do you have one? Did you misspell it?
@devangperiwal40312 жыл бұрын
Did you find out what was causing the error? I encountered the same error
@King_50411 ай бұрын
first time seeing class based views, thx
@Codemycom11 ай бұрын
welcome
@RamYadav-kl1xk4 жыл бұрын
Awesome course .super easy for beginners to learn Django
@Codemycom4 жыл бұрын
Glad you think so!
@pademo573 жыл бұрын
Hi John, at 2:00 when you added the ListView and DetailView on 1 line it wouldn't work for me until I changed them into 2 separate lines: from django.views.generic.list import ListView from django.views.generic.detail import DetailView Not sure if anyone else had this problem. Keep up the great work. Love the videos! And yes, I am a subscriber!
@Codemycom3 жыл бұрын
nice
@gustavosanchezmuller31173 жыл бұрын
Reverse for 'article-details' with no arguments not found. 1 pattern(s) tried: ['article/(?P[0-9]+)$'] :( help please, im using django 2.1.2
@elwinjyothis53884 жыл бұрын
Dude you have been repliying to all. So thaught why not me Great video the deal is a reply
@Codemycom4 жыл бұрын
:-p
@mateusneves88610 ай бұрын
Hi John, can you explain to me at the for loop where the object_list came from? Thanks, love from Brazil!
@FootyPick4 жыл бұрын
Amazing 💓💓💓💓
@Codemycom4 жыл бұрын
Thanks
@jay-jaypagulayanucol93039 ай бұрын
Just 2 question for clarification. 1. Does the "post" in the "post.title" in the detailview implementation referenced to the name of the Model? if so, for example my model name is "Main" so in detailview, I just say "main.something" to reference it? 2. How does the detailview know what pk is clicked. Does it automatically knows that the url contains the pk? or does it base on the / Thankyou very much for the concise and clear tutorial
@Codemycom9 ай бұрын
no, post is the form that is POST'ed... you use it in the manner that it's used in the video. 2) it knows the pk from the url, which IS the ...that's the URL
@jay-jaypagulayanucol93039 ай бұрын
@@Codemycom oh it uses the Method "POST" as reference. Thankyou very much, i can now proceed in the videos.
@saudagarfarhan62911 ай бұрын
you are amazing teacher
@Codemycom11 ай бұрын
Thanks!
@jamesmoyer72844 жыл бұрын
When I created the clickable link for the detailed blog html and clicked on the link I got: File "C:\ProgrammingStuff\Enviroments\PapagaioTech\lib\site-packages\django\template\loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) django.template.exceptions.TemplateDoesNotExist: HeatherBlog/post_detail.html [25/Jan/2021 12:14:11] "GET /article/1 HTTP/1.1" 500 77417 After creating a Heather folder in templets and renaming the detailed article html to post_detail.html everything worked fine at this time. Did this have something to do with (from django.views.generic import ListView, DetailView)? or did I miss something in the video?
@habiborrahaman45313 жыл бұрын
same problem my pc, how to sole this
@isabelpena2953 жыл бұрын
Hey, I did everything just like you did but an error came up: Reverse for 'listing_details' with arguments '('',)' not found. Any idea on how to fix it?
@outervumedia2 жыл бұрын
What would be the best method to add the title or title tag at the end of the post id? Would like to do so for SEO purposes.
@helloworld36833 жыл бұрын
Is there any github repository where we can get the source code for all blog series ?
@SajjadHematiNourani2 жыл бұрын
Mr. Elder I need different types of single posts. How can I make suck thing? (for example my articledetails in one post is different from another post)
@mohaimanulislammahin87224 жыл бұрын
Awsome bro .....thats good
@Codemycom4 жыл бұрын
Thanks!
@gouthamgoutham76404 жыл бұрын
Sir i have created 5 models such as education exersices sports under one app will the primary key will be affected to display detail page ??
@MrG88ful2 жыл бұрын
Hi, thank you for your fantastic tutorial! How do I get a "next article" and "previous article" link in the detail article page? thank you so much
@dadofalltrades36414 жыл бұрын
Thanks for the video John. a question regarding generic views. So, by default, is 'object_list' the context variable name for the query_sets in template tags whenever we make a class that inherits from genric ListView? and is 'post' the default context variable name for a model in template tage whenever we make a class that inherits from generic DetailView?
@amohampofo4 жыл бұрын
To be 100% sure the context variable name do: class ArticleDetailView(DetailView): model = Posts context_object_name = 'post'
@francisonyenekwe91363 жыл бұрын
Thanks @Godwin amoh. This your line of code just helped me out. I have been stuck in a loop since wondering what I did wrong that make my page return blank
@romaricvivien89652 жыл бұрын
@@amohampofo Thanks you very much !!! it helps me !!!!
@FootyPick4 жыл бұрын
Can you make one small video on how to use slug instead of ids and filter the blog post with slug
@Codemycom4 жыл бұрын
Yeah we'll talk about slugs eventually
@luffytaro-tg1gm Жыл бұрын
Wow this was fun !!
@Codemycom Жыл бұрын
Happy to hear it!
@siddhartht13453 жыл бұрын
Wonderfull vid John, Can u suggest which material should I have to use to lean django..
@Codemycom3 жыл бұрын
All the django videos on my channel :-p
@hariharanbalasubramanianpr42434 жыл бұрын
I think we can use the function also right sir???
@Codemycom4 жыл бұрын
Sure
@slayeroff77984 жыл бұрын
Hey Hello, So far your course is amazing!! However I am getting this error when I runserver in 8:51 ..:- path("",HomeView.as_view(),name="home"), AttributeError: 'function' object has no attribute 'as_view'
@Codemycom4 жыл бұрын
Check your code for typos
@slayeroff77984 жыл бұрын
@@Codemycom Thanks for your quick reply.....I figured it out ...typed "def" instead of "class"..!
@rudramunihublimath964 жыл бұрын
nice video.. Please make videos on database read and filter based on few fields. (Reporting) . If possible export it to csv or excel file.
@Codemycom4 жыл бұрын
Thanks!
@jhoanmartinezsilva26094 жыл бұрын
If not works post.title or any field try object.title and so on with all the fields
@caezar9743 жыл бұрын
Thanks!!!
@shishirhossain17673 жыл бұрын
is there any issue with post.title and Post.title? We named our model Post. So it should b post in html files. I mean, I am confused, for me both worked, Post and post. Can anyone xpln plz?
@petecodes3 жыл бұрын
I'm not having any luck when it comes to posting to getting the post.title etc on the new template. How does django know what it is referring to if there isn't the for loop?
@smishra63783 жыл бұрын
You can set the context_variable_name to the name you prefer in order to be sure. Code snippet: class ArticleDetailView(DetailView): model = Posts context_object_name = 'post'
@petecodes3 жыл бұрын
@@smishra6378 Thanks! Sorted now.
@jenifer54632 жыл бұрын
Classed based home views how to define home page display only 3 post instead of many post.. Please hope only line of cpde just need... I can do it from function based views...respected sir
@brunoruiztalamo3692 Жыл бұрын
Hi, I cannot access posts' primary keys.. I'm given a NoReverseMatch no matter what I do.
@mekkismart71984 жыл бұрын
Nice tutorial!
@Codemycom4 жыл бұрын
Thanks!
@rad.strums4 жыл бұрын
Please tell how to add the comment option to the posts too
@ИгорьКузнецов-т8р4 жыл бұрын
Hi! Can you explain in one of your next videos how to let user of our blog to add images/pictures to his posts? I mean to add pitcures to blog when it will be deployed at server or hosting.
@Codemycom4 жыл бұрын
That's easy to do locally, not so easy to do with a web host. Many hosts, like heroku, won't let you add images to a database...you need to add them to something like AWS and then reference them from the database.
@ИгорьКузнецов-т8р4 жыл бұрын
@@Codemycom hmm of course it would be more interesting to know how to use AWS🤔
@anoshwasker46353 жыл бұрын
I can't seem to get anything inside my django for loop to be displayed on screen. Any suggestions?
@Codemycom3 жыл бұрын
django uses a different convention for for loops…check the docs
@habiborrahaman45313 жыл бұрын
For loop, object_list variable this not understanding. Where to you find this variable object_list tell me, someone
@sarangkkl2143 жыл бұрын
sir i try the same but i successfully display the blog but when i am clicking on a particular blog i reach on the desired url but that page is blank i guess only primary key is passing not the other types of data like the blog and extra
@sarangkkl2143 жыл бұрын
thanks sir i get help from the comment section itself it says object.field_name works fine
@ashwinbalaji42163 жыл бұрын
how to set author as default with the current user
@emranhossainrashed34594 жыл бұрын
please sir reply my comment. nice tutorial but i want to ask you one thing and that is in article_details.htm you have used {{post.title}} where you got this post- i mean it's working but i want to know where it come from
@Codemycom4 жыл бұрын
I named it that in the loop that we write. You can name it anything, I chose post.
@gabrielaraya32423 жыл бұрын
Ive been following this tutorial but the detail view seems not to be rendering the data, any ideas?
@Codemycom3 жыл бұрын
You just have a typo somewhere
@aexiliakanzawa11873 жыл бұрын
question can i use the title instead of the primary key?
@Codemycom3 жыл бұрын
Give it a try
@kanharajput54434 жыл бұрын
you make me to make blog post page. Thanks a lot
@Codemycom4 жыл бұрын
Glad to hear that
@ritankarbhattacharjee76613 жыл бұрын
I have written the exact same codes but for some reason my code isn't displaying the data. There are no errors but still
@Codemycom3 жыл бұрын
You're wrong, there are errors you just haven't noticed them.
@ritankarbhattacharjee76613 жыл бұрын
@@Codemycom Yes sir, but for me post.body didn't work for me object.body worked the primary key was being referenced but the data was not being displayed . By the way you're videos are helping a lot, thank you so much ❤️
@adam84024 жыл бұрын
Does anyone know if posts like this with Django are picked up by Google with decent SEO or are static pages still king for SEO?
@Codemycom4 жыл бұрын
Sure, a web page is a web page to google. Static pages have never been king with google. Google like changing fresh content and always has.
@adam84024 жыл бұрын
@@Codemycom glad to hear that, thanks for taking the time to respond
@Codemycom4 жыл бұрын
@@adam8402 Sure thing
@joyhossain14514 жыл бұрын
I made a blog website that you showed in your videos. Now can I apply for google adsense to this website. Please Reply! I'm your big fan! BTW Thanks a lot dear.
@Codemycom4 жыл бұрын
Yes you can!
@Gsnchez4 жыл бұрын
I'm seeing the template tags {{post.author}} etc... hardcoded in the html and can't find why
@Codemycom4 жыл бұрын
To output the author to the screen?
@carlosamaral69174 жыл бұрын
Same problem!
@carlosamaral69174 жыл бұрын
Ok! I just solved the problem! It was all a matter of indentation in my case!
@Codemycom4 жыл бұрын
@@carlosamaral6917 Glad you got it sorted out
@carlosamaral69174 жыл бұрын
@@Codemycom Thanks for your videos! They're being really helpful for myself! Btw, in this case, the problem is just related to the indentation in both home.html and article details.html. Playing a bit with enter and changing the way the code is organized solves it all... I'm using linux ubuntu, not sure if it can be related to it, as it seems like the indentation you used worked for you and for all those who didn't complain about! Thanks one more time!!
@delphinemiel44173 жыл бұрын
Thank you so much for your work. My DetailView doesn't show the details informations. I don't have any error message but my {{ post.title }} doesnt't appear. It is empty in html
@mjokce3 жыл бұрын
Same! Did you find a solution ?
@ervian1077 Жыл бұрын
@@mjokceare you already find any solution?
@heroCode204 ай бұрын
Thank you for learn
@Codemycom4 ай бұрын
My pleasure
@sohaibss80734 жыл бұрын
Can i add a new app in ablog you startapp in ablog and you named it post i want to start a new app in ablog or i need to creat a new folder ?
@Codemycom4 жыл бұрын
the same terminal command we used to create our app will create another app, then add it to your settings.py file as we did
@hungnguyen6064 жыл бұрын
thank for your tutorial
@Codemycom4 жыл бұрын
Very welcome!
@kushagrachaturvedi21442 жыл бұрын
Templete does not exist at /article/1/, What could be wrong here.
@rakeshthakur83844 жыл бұрын
It's coming syntax error in theblog.urls at name = article-detail.
@Codemycom4 жыл бұрын
Look there for a typo then
@bigsandip4 жыл бұрын
Nice
@Codemycom4 жыл бұрын
Thanks!
@gouthamgoutham76404 жыл бұрын
Why i am not getting detail pages sir ?? It's showing blank page
@Codemycom4 жыл бұрын
Because you did something wrong. I couldn't guess what. Rewatch the videos and try again.
@gouthamgoutham76404 жыл бұрын
@@Codemycom thank's for replying sir and problem is i have created 5 models such as exersice entertainment soon will primary key will get effected sir ???
@phronessys4 жыл бұрын
Hi sir, everything works fine, except that i cant use the references like {{post.title}} in article_details.html, it just let me write in and use the buttons. Btw thanks for the vid!
@Codemycom4 жыл бұрын
Must be a typo somewhere in your code
@singhshubham7654 жыл бұрын
use {{ object.title }}
@lesterramos68374 жыл бұрын
When i click the link created i have an error named TemplateDoesNotExist at /article/1
@Codemycom4 жыл бұрын
weird
@Kennerdoll Жыл бұрын
Kindly help me undestand this: if i do {{ post.title }} its not working but {{ object.title }} is working
@Codemycom Жыл бұрын
What did you do differently from the video?
@Kennerdoll Жыл бұрын
@@Codemycom I honestly have no idea, am trying to figure it out here
@RamYadav-kl1xk4 жыл бұрын
My link is not working. I exactly followed the way you were doing
@Codemycom4 жыл бұрын
You have a typo somewhere
@RamYadav-kl1xk4 жыл бұрын
@@Codemycom didn't get what is typo
@habiborrahaman45313 жыл бұрын
error : raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) please help me
@ReganMilne4 жыл бұрын
Is anyone getting a 404 error with '\templates\the_blog\post_detail.html (Source does not exist)' when following the links from the home page?
@ReganMilne4 жыл бұрын
Server is running, error persists.
@Codemycom4 жыл бұрын
@@ReganMilne Nope...you have an error in your code somewhere, or you misspelled post_detail.html
@ReganMilne4 жыл бұрын
@@Codemycom OK I'm re-rewatching. I don't even remember creating a file by that name. thnx for the response btw.
@ReganMilne4 жыл бұрын
Template-loader postmortem Django tried loading these templates, in this order: Using engine django: django.template.loaders.app_directories.Loader: C:\simpleblog\virt\lib\site-packages\django\contrib\admin\templates\the_blog\post_detail.html (Source does not exist) django.template.loaders.app_directories.Loader: C:\simpleblog\virt\lib\site-packages\django\contrib\auth\templates\the_blog\post_detail.html (Source does not exist) django.template.loaders.app_directories.Loader: C:\simpleblog\a_blog\the_blog\templates\the_blog\post_detail.html (Source does not exist)
@Codemycom4 жыл бұрын
@@ReganMilne as I said, you probably misspelled post_detail.html look in your sublime text. see it listed there in the templates directory? Did you misspell it? You misspelled it there, or in your view, or in your urls, or in the link on the navbar.
@manpreetkaur-xn4md2 жыл бұрын
hello sir, user first name and last name now showing, what's the issue
@Codemycom2 жыл бұрын
You'l have to rewatch the video and figure out what you did differently than the video.
@habiborrahaman45313 жыл бұрын
raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) how to solve this issue
@miraccan004 жыл бұрын
can we use slug :)
@Codemycom4 жыл бұрын
sure
@rahulagarwal56944 жыл бұрын
getting this error 'function' object has no attribute '_default_manager'
@Codemycom4 жыл бұрын
what's the whole error, it usually tells you where in the code the error occurs
@rahulagarwal56944 жыл бұрын
never mind problem solved by make a new migration
@mlal8310 ай бұрын
And I found you after hours of slaving and trying to figure it out myself 😢
@Codemycom10 ай бұрын
Ha
@mlal839 ай бұрын
@Codemycom dude my codes good and shows up on django but won't show on my website. Any ideas? I've ran the whole cod in chatgpt for spot the mistake and it's saying there's nothing wrong with it
@heroCode204 ай бұрын
❤❤❤❤❤❤❤❤
@Codemycom4 ай бұрын
Thanks
@snehikaushik50084 жыл бұрын
my detailview is not working ... plz help
@Codemycom4 жыл бұрын
You likely have a typo in your code...check it against the code in the video.
@habiborrahaman45313 жыл бұрын
not working sir please can you help me ?
@ahsinjee20093 жыл бұрын
HI i am getting error when i create delete_post.html the error is as fellows Page not found (404) Request Method: GET Request URL: 127.0.0.1:8000/ Using the URLconf defined in blogApp.urls, Django tried these URL patterns, in this order: admin/ / The empty path didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. i try to fix but i cant thats why i send you message please if you can fix this issue if you want to repo i will forward you Mohammed Javed
@maniksharma4872 жыл бұрын
i got a error template doesn't exist. can anyone help?
@Codemycom2 жыл бұрын
Make sure your template exists and is in the right place
@nevergotfat3 жыл бұрын
For DetailView add: context_object_name = 'post', incase your page details page is blank
@yassineahlaou65223 жыл бұрын
nice man
@facundoibarra75092 жыл бұрын
OMG THANK U SO MUCH. I was having that problem and I had no idea how to look it up!!!
@sifadrifad42024 жыл бұрын
thank you sir
@Codemycom4 жыл бұрын
Thank you for watching!
@andrewhkh233 жыл бұрын
i Have Error [ Exception Value: 'for' statements should use the format 'for x in y': for post in object list ] Its all Works!!! I just forget in ( for post in object list) [ for post in object_list ]
@nabilm7914 жыл бұрын
>
@Codemycom4 жыл бұрын
you need a product_detail view in your views.py file...there's a typo or something there
@nabilm7914 жыл бұрын
@@Codemycom this is my vieiew : class ProductDetail(DetailView): model=Product template_name='product_detail.html'
@nuke44962 жыл бұрын
thank you
@Codemycom2 жыл бұрын
welcome!
@rachelbakerx54314 жыл бұрын
👏🏼🙌🏼
@Codemycom4 жыл бұрын
Thanks!
@mekkismart71984 жыл бұрын
Print(“you are awesome”)
@Codemycom4 жыл бұрын
Thanks!
@scipiopersicus19282 ай бұрын
👍
@dinindutheekshana22543 жыл бұрын
Hello sir can I have source code
@Codemycom3 жыл бұрын
github.com/flatplanet/djangoblog
@dinindutheekshana22543 жыл бұрын
@@Codemycom thankyou so much sir I use this my other projects as well