From e7c3c33c16fb7688429f19ef3d54b69aac29c995 Mon Sep 17 00:00:00 2001 From: Nivedhakaliaperumal76 Date: Mon, 29 Dec 2025 21:13:32 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b8955b4..a9ccf559 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,120 @@ Create a HTML file to implement form based input and output. Publish the website in the given URL. # PROGRAM : -# SERVER SIDE PROCESSING: -# HOMEPAGE: +math.html + + + + + Area of Rectangle + + + + + +
+
+ +

Area of a Rectangle

+ +
+ {% csrf_token %} + +
+ Length : + + (in m) +
+ +
+ Breadth : + + (in m) +
+ +
+ +
+ +
+ Area : + + m2 +
+
+ +
+
+ + + +views.py + +from django.shortcuts import render + +def rectarea(request): + context = {} + context['area'] = "0" + context['l'] = "0" + context['b'] = "0" + + if request.method == 'POST': + print("POST method is used") + l = request.POST.get('length', '') + b = request.POST.get('breadth', '') + + print('request =', request) + print('Length =', l) + print('Breadth =', b) + + area = int(l) * int(b) + + context['area'] = area + context['l'] = l + context['b'] = b + + print('Area =', area) + + return render(request, 'mathapp/math.html', context) + +urls.py + +from django.contrib import admin +from django.urls import path +from mathapp import views + +urlpatterns = [ + path('admin/', admin.site.urls), + path('areaofrectangle/', views.rectarea, name="areaofrectangle"), + path('', views.rectarea, name="areaofrectangleroot"), +] +# SERVER SIDE PROCESSING: (https://github.com/user-attachments/assets/d3448e8e-cdb7-40f8-bd9a-3addd7491f6e) +# HOMEPAGE: (https://github.com/user-attachments/assets/699e584d-13a2-4555-8728-77ef01184d29) # RESULT: The program for performing server side processing is completed successfully. From 0fbcd3662f6726e7532ede3b6ce4ab07fb6b1a92 Mon Sep 17 00:00:00 2001 From: Nivedhakaliaperumal76 Date: Mon, 29 Dec 2025 21:32:25 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9ccf559..8cce59e5 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,8 @@ urlpatterns = [ path('areaofrectangle/', views.rectarea, name="areaofrectangle"), path('', views.rectarea, name="areaofrectangleroot"), ] -# SERVER SIDE PROCESSING: (https://github.com/user-attachments/assets/d3448e8e-cdb7-40f8-bd9a-3addd7491f6e) -# HOMEPAGE: (https://github.com/user-attachments/assets/699e584d-13a2-4555-8728-77ef01184d29) +# SERVER SIDE PROCESSING: +# HOMEPAGE: ![area](https://github.com/user-attachments/assets/0dfbdcae-0f21-4807-86f5-67ed3a3f55d0) + # RESULT: The program for performing server side processing is completed successfully.