hobbes3
hobbes3

Reputation: 30238

Should I override a template for a Django (comments) framework or do the customization inside my own templates?

I am trying to customize the output of the comments list and forms using Django's comments framework.

Inside my own template, should I try to customize the comments by doing something like {% get_comment_form for object as form %} and carefully construct the form based on the form variable or should I override the form.html template and simply call {% render_comment_form for object %}?

Currently I'm leaning more toward using {% get_comment_form for object as form %} inside my own template, but using form.html as a guideline to write my own form.

Upvotes: 1

Views: 148

Answers (1)

jpic
jpic

Reputation: 33420

On my websites, overriding form.html (and other comments templates) and simply calling {% render_comment_form for object %} works very well.

You should definitively have a form.html that is customized for your website's design. And in case you want a comment form to have a particular design, you can use get_comment_form.

Upvotes: 1

Related Questions