Django, a high-level Python Web framework, is renowned for its robustness and versatility. When it comes to creating HTML templates in Django, the process is straightforward and efficient. Let's delve into an example that demonstrates how to create an HTML template and use it in a Django view.

Before we dive into the code, it's crucial to understand that Django uses a template language to insert dynamic content into your HTML. This language is quite simple and allows you to output variables, perform loops, and use conditional statements.

Creating an HTML Template
Let's start by creating a simple HTML template named 'index.html' in a directory named 'templates' within our app. Django follows the convention that templates should be stored in a directory named 'templates' within each app.

Here's a basic example of what 'index.html' might look like:
```html
Welcome to my Django App!

This is a simple HTML template in Django.
```
Using the Template in a Django View
Now that we have our template, let's use it in a Django view. In your app's 'views.py' file, you'll need to import the template and render it with some data.

Here's how you can do it:
```python from django.shortcuts import render def index(request): data = { 'message': 'Hello, World!' } return render(request, 'index.html', data) ```
Passing Data to the Template
In the above code, we're passing a dictionary 'data' to the 'render' function. This dictionary contains key-value pairs that we can use in our template. Let's update our 'index.html' template to use this data:

```html
Welcome to my Django App!
{{ message }}




















```
In the template, we use double curly braces '{{ }}' to output the value of the 'message' variable. When the view is called, Django will replace '{{ message }}' with the value 'Hello, World!'.
Creating a List in a Django Template
Django templates also allow you to loop through lists. Let's add a list of items to our view and update our template to display it.
In your 'views.py', add a list to the 'data' dictionary:
```python def index(request): data = { 'message': 'Hello, World!', 'items': ['Item 1', 'Item 2', 'Item 3'] } return render(request, 'index.html', data) ```
Then, in your 'index.html', use the 'for' loop syntax to display the items:
```html
Welcome to my Django App!
{{ message }}
-
{% for item in items %}
- {{ item }} {% endfor %}
```
With this, you've created a simple Django HTML template that displays dynamic content. Django's template language is powerful and flexible, allowing you to create complex templates with ease. Now, go forth and build your Django applications!