When starting a Django project, we should create views and map them to URLs. Easy and straightforward, but why is it all confusing?
Let’s try to break it down.
There are two types of views that you can create in Django: function based views and class based views.
I'll focus on function-based views here.
Function based views have two types of responses: a simple HTTP Response, or they can render a template.
The following view returns an HTTPResponse:
The second view renders a template, which is the about us page, about.html:
Top comments (0)