Skip to content

kabilselvam/serversideprocessing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design a Website for Server Side Processing

AIM:

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

DESIGN STEPS:

Step 1:

Create the repository from GitHub

Step 2:

Create Django Admin project.

Step 3:

Create a New App.

Step 4:

Create python programs for views and urls.

Step 5:

Create a HTML file of forms.

Step 6:

Publish the website in the given URL.

PROGRAM :

''' math.html

<title>Area of Rectangle</title> <style type="text/css"> body { background-color:red; } .edge { width: 1440px; margin-left: auto; margin-right: auto; padding-top: 250px; padding-left: 300px; } .box { display:block; border: Thick dashed lime; width: 500px; min-height: 300px; font-size: 20px; background-color:blue; } .formelt{ color:orange; text-align: center; margin-top: 7px; margin-bottom: 6px; } h1 { color:rgb(255, 0, 179); text-align: center; padding-top: 20px; } </style>

Area of a Rectangle

{% csrf_token %}
Length : (in m)
Breadth : (in m)

Area : m2

views.py

from django.shortcuts import render def rectarea(request): context={} context['area'] = "0" context['l'] = "0" context['b'] = "0" if request.method == 'POST': print("POST method is used") l = request.POST.get('length','0') b = request.POST.get('breadth','0') print('request=',request) print('Length=',l) print('Breadth=',b) area = int(l) * int(b) context['area'] = area context['l'] = l context['b'] = b print('Area=',area) 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('areaofrectangle/',views.rectarea,name="areaofrectangle"), path('',views.rectarea,name="areaofrectangleroot") ] '''

OUTPUT:

OUTPUT

Home Page:

Home Page

Result:

The program for implementing server side processing is completed successfully.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 84.0%
  • HTML 16.0%