Usage ===== Tapeforms provides a :doc:`Mixin ` to add the required functionality to the Django forms which is required for rendering the whole form and its fields using Django templates. .. code-block:: python from django import forms from tapeforms.mixins import TapeformMixin class ContactForm(TapeformMixin, forms.Form): name = forms.CharField() email = forms.EmailField() text = forms.CharField(widget=forms.Textarea) Together with some template code you get some beautiful rendered forms. .. code-block:: jinja {% load tapeforms %}
{% csrf_token %} {% form form %}
By default, the form will be rendered using the ``tapeforms/layouts/default.html``. To learn how to override the template which is used, please refer to the :doc:`Advanced usage section `. If you don't want to override the template, you might also use the `as_tapeform` shortcut. .. code-block:: jinja
{% csrf_token %} {{ form.as_tapeform }}
.. note:: For a full overview of the methods you might override to customize the rendering of your forms, go to the :doc:`API Reference for mixins `.