To design a website to calculate the power of a lamp filament in an incandescent bulb in the server side.
P = I2R P --> Power (in watts) I --> Intensity R --> Resistance
Clone the repository from GitHub.
Create Django Admin project.
Create a New App under the Django Admin project.
Create python programs for views and urls to perform server side processing.
Create a HTML file to implement form based input and output.
Publish the website in the given URL.
<!DOCTYPE html>
<html>
<head>
<h2>DHARUN DHANRAJ R (25017737)</h2>
<center>
<title>Power Calculator</title>
</center>
</head>
<body>
<h2>Power Calculator</h2>
<p>(Power) equals to I² (square of current) times R (Resistance)</p>
<label>Current (amperes):</label>
<input type="number" id="current"><br><br>
<label>Resistance (ohms):</label>
<input type="number" id="resistance"><br><br>
<button onclick="calculatePower()">Calculate Power</button><br><br>
<label>Power (watts):</label>
<input type="text" id="power" readonly style="background-color:#dedada;"><br><br>
<script>
function calculatePower() {
let current = parseFloat(document.getElementById("current").value);
let resistance = parseFloat(document.getElementById("resistance").value);
if (isNaN(current) || isNaN(resistance)) {
alert("Please enter valid numbers for current and resistance.");
return;
}
let power = current * current * resistance;
document.getElementById("power").value = power.toFixed(2) + " W";
}
</script>
</body>
</html>
The program for performing server side processing is completed successfully.

