In the above coding, we have included HttpResponse to provide the HTML code. As we are required to display the response as a web page only, that is why we need to map it to a URL.

Well, the above code is not the best way by which we can render HTML in an application’s view. The MVT pattern of Django makes it much easier. After the use of Django – MVT, we need to make use of a template, which is

Myapp/templates/hello.html

After the required changes, the new view will appear like the following:

Passing Parameters to A View
It is possible for a view to have parameters which imply that a view accepts parameters. Whenever this view gets linked to a URL, it will display the number which is passed in it as the parameter.