Learn Django

Update the Template

The subscriber template must be updated to include fields to collect the name and address information. This is done by adding additional input fields to the form that was already present.

Open the /.../crmeasy/templates/subscribers/subscriber_new.html file. Locate the {# Billing Address Section #} comment and add this code directly beneath it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{# Billing Address Section #}
<h5 class="sn-sh">YOUR BILLING ADDRESS</h5>
<table class="table">
    <tbody>
        <tr>
            <th>{{ form.first_name.label }}</th>
            <th>{{ form.last_name.label }}</th>
        </tr>
        <tr>
            <td>{{ form.first_name }}</td>
            <td>{{ form.last_name }}</td>
        </tr>
        <tr>
            <td>{{ form.first_name.errors }}</td>
            <td>{{ form.last_name.errors }}</td>
        </tr>
        <tr>
            <th>{{ form.address_one.label }}</th>
            <th>{{ form.address_two.label }}</th>
        </tr>
        <tr>
            <td>{{ form.address_one }}</td>
            <td>{{ form.address_two }}</td>
        </tr>
        <tr>
            <td>{{ form.address_one.errors }}</td>
            <td>{{ form.address_two.errrors }}</td>
        </tr>
        <tr>
            <th>{{ form.city.label }}</th>
            <th>{{ form.state.label }}</th>
        </tr>
        <tr>
            <td>{{ form.city }}</td>
            <td>{{ form.state }}</td>
        </tr>
        <tr>
            <td>{{ form.city.errors }}</td>
            <td>{{ form.state.errors }}</td>
        </tr>
    </tbody>
</table>

Commit Changes

Execute these commands to commit your changes in Git.

1
2
3
4
5
# add files
(venv)$ git add .

# commit files
(venv)$ git commit -m "updated the new subscriber template"

Track your progress with a free account