A typical Django project follows an MVC-based architecture. The user requests first hit the URLs configured in the Urls.py file, and from there it is forwarded to the appropriate view. The view acts as middleware between the backend core logic and the template/HTML that is rendered to user. views.py has various methods, each of which corresponds to the URL mapper in the Urls.py file. On receiving the request, the logic written in the views class or method prepares the data from models.py and other core business modules. Once all the data is prepared, it is rendered back to the user with the help of templates. Thus, the templates form the UI layer of the web project.
The following diagram represents the Django request-response cycle: