Hi!
This mini-tutorial will focus on creating a Comment Section for adding (without update/delete) comments to each blog post. We will implement t...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for sharing this wonderful post. Homepage
Glad that I helped you!
Welcome de DEV Community, have a wonderful week!
Hi @Radu,
Great article but I just want to point out a few issues. The first is in your
BlogPostDetailView
This is bound to throw a
Type Error
. In this case, it will be anobject not callable
error.The other issue I see arising is with the post:
The
blogpost_connected
should be an instance of theBlogPost
and not theBlogComment
. I hope this is helpful. Best regards.Hey, thanks for this mini tutorial! I appreciate that it's detailed but simple. Made an account here just to say thanks, it kinda saved me today :)
Thank you!
I like to break the whole code into smaller steps, without puzzling the viewer with extra complexity or missing code parts. However, it's hard to find the extra time to write those kinds of posts, but appreciations like these motivate me.
Welcome to DEV Community!
Thanks for sharing this post with us I was searching for these tip from many days then my best friend suggests me your post now she need help regarding dissertation proofreading services and I want to help her. So if anyone knows about this please let me know.
great tutorial, awesome code. Thanks man, you made my day. I also made an account today just to leave you a message. PS it never happens
What if i don't need the user to be logged in? I'm working in a comment system for my personal site without a registration system :-)
Thanks.
Hmm... I didn't think about this option. But the process should be even simpler than the instructions I've written here.
Firstly, in our
models.py
we don't need an author based on User anymore, we will just useTextField()
:[Optional] We can still return the number of comments if we want in our main
BlogPost
class model inmodels.py
:Make the changes to our database:
Create the same
forms.py
with an author:And now in
views.py
we don't need to check ifself.request.user.is_authenticated
anymore, we will just send the form as context to our HTML-basedblogpost_detail.html
.And finally in our
blogpost_detail.html
we'll show directly the forms without checking ifuser.is_authenticated
.Hope all of these will work. Good Luck!
Thanks for publishing Python information. This is very understanding and useful to me
Amazing!! Thank you a lot!! It's more or less how i thought it should be, now i can continue with the project :-D
Students should check for certain terms while examining the best cv writing service london as some essay reviews regularly utilize keywords such as me and I, signaling that they are aiming to generate credibility and obtain confidence. Because they want to be honest, genuine customers or users prefer nouns.
Thanks Man
masterbundles.com/stock-content/ve...
what should i do if i have to use same comment model in different place
test