From 15a142d9b29cf6ad7947b519153497fca50b9d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bu=C4=9Fra?= <11869756+bgr8@users.noreply.github.com> Date: Fri, 26 May 2023 16:58:07 +0300 Subject: [PATCH] Refactor index view to improve code readability and maintainability --- hello_world/core/views.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hello_world/core/views.py b/hello_world/core/views.py index b6936cf..06ce765 100644 --- a/hello_world/core/views.py +++ b/hello_world/core/views.py @@ -1,10 +1,7 @@ from django.shortcuts import render def index(request): - return render( - request, - "index.html", - { - "title": "Django example", - }, - ) + context = { + "title": "Django example", + } + return render(request, "index.html", context)