To design a website to perform mathematical calculations in server side.
Design your website for calculation using wireframe work.
Then to execute the wireframe work desing use html,css.
Use views.py to execute the coding in serverside.
Mention the path of the website in urls.py
Publish the website in the given URL.
*HTML CODE
<title>Volume Calculator</title> <style> *{ box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; }body{
background-color: lightblue;
color:blue;
}
.container{
width: 1080px;
height: 350px;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
border-radius: 25px;
border: 10px solid cyan;
box-shadow: inset 0 0 15px rgb(231, 217, 160);
background-color:lightgreen;
}
h1{
color: rgb(0, 0, 0);
text-align: center;
}
.calculate{
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
padding-right:10px;
text-align: center;
font-size: 20px;
padding-top: 7px;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
Views.py
from django.shortcuts import render
def volumecalculation(request): context ={} context["volume"]='0' context["h"]='0' context["l"]='0' context["w"]='0' if request.method == 'POST':
h=request.POST.get('height','0')
l=request.POST.get('length','0')
w=request.POST.get('width','0')
volume=int(h)*int(l)*int(w)
context['volume'] = volume
context['l']=l
context['h']=h
context['w']=w
return render(request,"myapp/math.html",context)
urls.py
from django.contrib import admin from django.urls import path from myapp import views
urlpatterns=[ path('admin/',admin.site.urls), path('volofrectangulartank/',views.volumecalculation,name="volofrectangulartank"), path('',views.volumecalculation,name="volofrectangulartankroot") ]
A website to perform mathematical calculations in server side is created.