dhivyapriyar / serversideprocessing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Design a Website for Server Side Processing

AIM:

To design a website to perform mathematical calculations in server side.

DESIGN STEPS:

Step 1:

Clone into the repository named "serversideprocessing" and create a project named "myfirstproject"

Step 2:

Startapp myapp . Create a folder named 'templates' under which all html files are stored.

Step 3:

Make the necessary changes in the settings.py and add codes in urls.py and views.py which enables the operation to take place.

Step 4:

Under the templates anf myfirstapp, create a html file named math.html nad write the required html code for the website.

Step 5:

Then makemigrations and run the server to get the output.

Step 6:

Publish the website in the given URL.

PROGRAM :

<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Area of Rectangle</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style type="text/css">
body 
{
background-color:cyan;
}
.edge {
width: 1080px;
margin-left: auto;
margin-right: auto;
padding-top: 200px;
padding-left: 300px;
}
.box {
display:block;
border: Thick dashed lime;
width: 500px;
min-height: 300px;
font-size: 20px;
background-color: purple;
}
.formelt{
color: Red;
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
}
h1
{
color: yellow;
text-align: center;
padding-top: 20px;
}
</style>
</head>
<body>
<div class="edge">
<div class="box">
<h1>Area of a Rectangle</h1>
<form method="POST">
{% csrf_token %}
<div class="formelt">
Length : <input type="text" name="length" value="{{l}}"></input>(in m)<br/>
</div>
<div class="formelt">
Breadth : <input type="text" name="breadth" value="{{b}}"></input>(in m)<br/>
</div>
<div class="formelt">
<input type="submit" value="Calculate"></input><br/>
</div>
<div class="formelt">
Area : <input type="text" name="area" value="{{area}}"></input>m<sup>2</sup><br/>
</div>
</form>
</div>
</div>
</body>
</html>

OUTPUT:

Home Page:

HOMEPAGE

Calculations:

AREAOFRECT

Result:

Calculations are performed correctly as per the given inputs

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 84.4%Language:HTML 15.6%