SyntaxFix
Write A Post
Hire A Developer
Questions
Maybe you have no Comments record with such primary key, then you should use this code:
try: comment = Comment.objects.get(pk=comment_id) except Comment.DoesNotExist: comment = None