Form not appearing on website

I am creating a website using Django. I’d like to give users the chance to comment on pictures they have posted. I have created a comment model and a comment form, and put the following code into the HTML document for the photo gallery:

Leave a comment

{{ comment_form.as_p }} {% csrf_token %} Submit </form However, the form is not displaying - there is nothing between 'Leave a comment' and the submit button on the page. I don't understand this as my form in appears to be configured correctly:

class CommentForm(forms.ModelForm):
body = forms.CharField(help_text=“What is your comment?”, widget=forms.TextInput(attrs={‘size’: ‘1000’}),

class Meta:
model = Comment
fields = (‘body’,)
def as_p(self):
# Returns this form rendered as HTML

return self._html_output(

help_text_html=’ %s’,
So does my model in
class Comment(models.Model):

image = models.ForeignKey(Picture, on_delete=models.CASCADE, related_name=“comments”)
user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
body = models.TextField(max_length=COMMENT_MAX_LENGTH)
created_on = models.DateTimeField(auto_now_add=True)
active = models.BooleanField(default=False)

class Meta:
ordering = [‘created_on’]

def str(self):
return ‘Comment {} by {}’.format(self.body, self.user)

When I go into the source code on the site, it shows that the form is hidden. Also, when I change comment_form.as_p to something random, no error messages are generated. It’s like something is causing Django to skip past that bit of code.

I’d really appreciate any suggestions anyone could please offer.