From e119f1d3f39aa1677696c4635a643c090b007146 Mon Sep 17 00:00:00 2001 From: Elaiyavan-k Date: Mon, 28 Apr 2025 21:14:02 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 164 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 134 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index d2e0055e2..e419483ba 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,148 @@ # Ex.05 Design a Website for Server Side Processing -## Date: - -## AIM: - To design a website to calculate the power of a lamp filament in an incandescent bulb in the server side. - - -## FORMULA: -P = I2R -
P --> Power (in watts) -
 I --> Intensity -
 R --> Resistance - -## DESIGN STEPS: - -### Step 1: +# Date: +# AIM: +To design a website to calculate the power of a lamp filament in an incandescent bulb in the server side. + +# FORMULA: +P = I2R +P --> Power (in watts) + I --> Intensity + R --> Resistance + +# DESIGN STEPS: +## Step 1: Clone the repository from GitHub. -### Step 2: +## Step 2: Create Django Admin project. -### Step 3: +## Step 3: Create a New App under the Django Admin project. -### Step 4: +## Step 4: Create python programs for views and urls to perform server side processing. -### Step 5: +## Step 5: Create a HTML file to implement form based input and output. -### Step 6: +## Step 6: Publish the website in the given URL. -## PROGRAM : - - -## SERVER SIDE PROCESSING: - - -## HOMEPAGE: - - -## RESULT: +# PROGRAM : +### math.html +``` + + + + + + + serverside + + + + +

power of a lamp filament

+
+ {%csrf_token%} + +
+ + + +
+
+
+ + +
+
+ +
+
+
+ + + +
+
+ + +``` +### views.py +``` + +from django.shortcuts import render +def powerlamp(request): + context={} + context['power']="0" + context['i']="0" + context['r']="0" + if request.method=='POST': + print("POST method is used") + i=request.POST.get('intensity','0') + r=request.POST.get('resistance','0') + print('request=',request) + print('intensity=',i) + print('resistance=',r) + power=(int(i) ** 2 ) * int(r) + context['power']=power + context['i']=i + context['r']=r + print('Power=',power) + return render(request,'muni/math.html',context) +``` +### urls.py +``` + +from django.contrib import admin +from django.urls import path +from muni import views +urlpatterns = [ + path('admin/', admin.site.urls), + path('powerlamp/',views.powerlamp,name="powerlamp"), + path('',views.powerlamp,name="powerlamproot") +] + +``` +# SERVER SIDE PROCESSING: +![Screenshot (36)](https://github.com/user-attachments/assets/1df188bf-6dd3-414d-8a6a-7f0dcfec9ecb) + +# HOMEPAGE: +![Screenshot (37)](https://github.com/user-attachments/assets/8fca7352-9e93-43fe-bafe-3e14ac665562) + +# RESULT: The program for performing server side processing is completed successfully. From 4fc2ba5bbbcf008757ad819ed77c79b8777a5d7c Mon Sep 17 00:00:00 2001 From: Elaiyavan-k Date: Mon, 28 Apr 2025 21:16:12 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e419483ba..38564c690 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Ex.05 Design a Website for Server Side Processing -# Date: +# Date:26/04/2025 +## NAME: Elaiyavan .K + # AIM: To design a website to calculate the power of a lamp filament in an incandescent bulb in the server side.