8.2 Creating a New Template to Create Tag Objects

To accept data into a view to be processed by a Django view, we need to prompt the user to give us this data. We use an HTML form to do this (if you don’t know what this is, please refer to an HTML textbook).

Create the file /organizer/templates/organizer/tag_form.html, and code as shown in Example 8.1.

Example 8.1: Project Code

organizer/templates/organizer/tag_form.html in d3f0583ad0

 1  {% extends parent_template|default:"organizer/base_organizer.html" %}  2  3  {% block title %}  4  {{ block.super }} - Create Tag  5  {% endblock %}  6  7  {% block content %}  8    <form  9        action="{% url 'organizer_tag_create' %}" 10        method="post"> 11      

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.