From 12fcb5b6dc17e76eb2a85b43a717c9c91a06261c Mon Sep 17 00:00:00 2001 From: Elaiyavan-k Date: Mon, 28 Apr 2025 21:05:42 +0530 Subject: [PATCH] Update README.md --- README.md | 166 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 136 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index d2e0055e2..0a8d3caa5 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,150 @@ # 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:26/05/2025 +## NAME: Elaiyavan K +## REG NO: 24900184 +# 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/dd724648-8695-4065-9aa9-5f7ec4014eb0) + +# HOMEPAGE: +![Screenshot (37)](https://github.com/user-attachments/assets/0442e263-f488-46bf-858c-6cb5f59ccf00) + +# RESULT: The program for performing server side processing is completed successfully.