[Fixed]-Putting a class view in a template django

1👍

Just use {{ form }} to access all the fields defined inside your view class.

To access a specific field from the form, use dot operator, ie, {{ form.db_field_name }}

For ex,

{{ form.comment_text }}

This would create a label, input tags for the field comment_text.

You may also render the form as table or paragraph etc.

Leave a comment