> For the complete documentation index, see [llms.txt](https://sathyakumars-kb.gitbook.io/user-authentication-based-django-app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sathyakumars-kb.gitbook.io/user-authentication-based-django-app/model-view-templates-implementation.md).

# Model-View-Templates Implementation

## 1. Create a urls for view functions in TodoList > todo > urls.py

Type the below code in urls.py (refer Fig. 2.0)

<pre class="language-python"><code class="lang-python"><strong>from django.urls import path
</strong>from . import views

urlpatterns = [
    path('', views.Home.as_view(), name='home'),
    # Add other URL patterns as needed
]
</code></pre>

<figure><img src="https://2079142657-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1YvmVNRB9criaQoLf7c%2Fuploads%2F0ua5YSZTOkWFHFT8eGqM%2Fimage.png?alt=media&amp;token=c7dcdb95-f01c-4891-b6bf-c82bcfeb4c38" alt=""><figcaption><p>Fig. 2.0 todo > urls.py</p></figcaption></figure>

## 2. Write a view function for above mentioned urls

Type the below code in views.py (refer Fig. 2.1)

```python
from django.shortcuts import render
from django.http import HttpResponse
from django.views import View

class Home(View):
    def get(self, request):
        return HttpResponse("Hello, Django!")
```

<figure><img src="https://2079142657-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1YvmVNRB9criaQoLf7c%2Fuploads%2FVzvVMdZSNdLQx04IOiiK%2Fimage.png?alt=media&amp;token=943fae4a-3bcd-4587-a95b-527d02e9de0d" alt=""><figcaption><p>Fig. 2.1</p></figcaption></figure>

Output:

<figure><img src="https://2079142657-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1YvmVNRB9criaQoLf7c%2Fuploads%2FscIaXbo4JkAHHZ15H8TM%2Fimage.png?alt=media&amp;token=c42e3c4a-1674-481e-b824-4f6ce88db70c" alt=""><figcaption><p>Fig. 2.2 output </p></figcaption></figure>
