GithubHelp home page GithubHelp logo

mathserver's Introduction

Ex.05 Design a Website for Server Side Processing

Date:14-04-2024

AIM:

To design a website to find surface area of a Right Cylinder in server side.

FORMULA:

Surface Area = 2Πrh + 2Πr2
r --> Radius of Right Cylinder
h --> Height of Right Cylinder

DESIGN STEPS:

Step 1:

Clone the repository from GitHub.

Step 2:

Create Django Admin project.

Step 3:

Create a New App under the Django Admin project.

Step 4:

Create python programs for views and urls to perform server side processing.

Step 5:

Create a HTML file to implement form based input and output.

Step 6:

Publish the website in the given URL.

PROGRAM :

<title>Document</title> <style> .formelt{ color: orange; text-align: center; margin-top: 7px; margin-bottom: 6px; } h1 { color: rgb(255, 0, 179); text-align: center; padding-top: 20px; } body{ background-color:palegreen; } .edge { border:2px solid wheat; margin-top:10%; } </style>

Area of a Rectangle

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

Area: m2

from django.shortcuts import render

Create your views here.from django.shortcuts import render

def rectarea(request): context={} context ['area'] = "0" context['1'] = "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, 'app/math.html', context) from django.contrib import admin from django.urls import path from app import views

from django.contrib import admin from django.urls import path from app import views

urlpatterns = [ path('admin/', admin.site.urls), path('areaofrectangle/',views.rectarea,name="areaofrectangle"), path('',views.rectarea,name="areaofrectangleroot") ]

SERVER SIDE PROCESSING:

abc

HOMEPAGE:

abcd

RESULT:

The program for performing server side processing is completed successfully.

mathserver's People

Contributors

selvasachein avatar bharathjayachandran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.