There is at least a couple of way to do it.

1) by using {% extends %}

Change one of the template (e.g. oq-ui-client2/exposure_building_form.html) such that the variable part are surrounded by a block, e.g.:
```
<form {% block exposure_form_attrs %} id="exposure-building-form" class="exposure_export_form" {% endblock %}>
```

Then in the other template put only what you are extending (same as template pattern in OO):
```
{% extends "exposure/exposure_building_form.html" %}

{% block exposure_form_attrs %}
id="exposure-population-form" class="exposure_export_form"
{% endblock %}
```

Of course, a variant of this approach is to not have a default value and to use a third template file which acts as a "base template".

2) by using {% include %} (https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#include)

put the shared part in a file with variable parts extracted from django template vars. E.g.

```
<form id="{{form_id}}" class="{{form_class}}">
```

Then, in the derived templates:

{% include "shared.html" with form-id="exposure-population-form" %}