0% found this document useful (0 votes)
189 views

Project 1 Report

This document appears to be a project report submitted by two students, Sanya and Sanya Arora, for their B.Tech degree. The report focuses on developing a Blood Bank Management System. It includes sections on the company details where the project was developed, an acknowledgement of those who helped with the project, and a table of contents outlining the chapters to be included in the report. The chapters will cover introductions to Python as the programming language used, data types and operators in Python, and the design and implementation of the Blood Bank Management System.

Uploaded by

Sanya CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views

Project 1 Report

This document appears to be a project report submitted by two students, Sanya and Sanya Arora, for their B.Tech degree. The report focuses on developing a Blood Bank Management System. It includes sections on the company details where the project was developed, an acknowledgement of those who helped with the project, and a table of contents outlining the chapters to be included in the report. The chapters will cover introductions to Python as the programming language used, data types and operators in Python, and the design and implementation of the Blood Bank Management System.

Uploaded by

Sanya CSE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

A

Project I Report
On

Blood Bank
Management
System

Submitted for Partial Fulfillment of the Award


of Bachelor of Technology (B.Tech) in CSE
Kurukshetra University Kurukshetra

Submitted By:
SANYA
(1219295)

SANYA ARORA
(1219296)

Submitted to:
Er. Mamta
(Asstt. Professor)

Department of Computer Science and


Engineering

Seth Jai Parkash Mukand Lal Institute of Engineering & Technology


Affiliated to Kurukshetra University Kurukshetra
Declaration
We hereby certify that the work which is being presented in the Project I Report entitled, “Blood Bank
Management System” by us, Sanya (1219295), Sanya Arora(1219296) in partial fulfillment of the
requirements for the award of degree of Bachelor of Technology in Computer Science Engineering
submitted in the Department of Computer Science and Engineering at JMIT Radaur (Affiliated to
Kurukshetra University Kurukshetra, Haryana (India) is an authentic record of our own work carried out
under the supervision of Er. Mamta. The matter presented in the report has not been submitted in any
other University/Institute for the award of any degree.

(Sanya, Sanya Arora)

This is to certify that the above statement made by the candidate is correct to the best of our knowledge.

Er. Mamta
Asstt. Professor Department of Computer
Science and Engg. JMIT Radaur

Countersigned By: (Head of Department)

The B.Tech Project I Viva-voce examination of Sanya (1219295), Sanya Arora (1219296) has been
held on ………………….. and is accepted.

Er. Mamta ( Ex am i ne r )
(Supervisor)
ACKNOWLEDGEMENT

The writing of this project report has been assisted by the generous help of many people.
we feel that we were very fortunate to receive assistance from them. we wish to express
our sincere appreciation to them.

First and foremost, we are indebted to our principal supervisor, Er. Mamta (Asstt.
Prof., Department of Computer Science and Engineering) of JMIT Radaur, who has
been very supportive at every stage of our project completion. we wish to express our
utmost gratitude to her for the invaluable advice and patience in reading, correcting and
commenting on the drafts of this report and, more importantly, for his generosity which
we have received throughout our project completion.

we would like to acknowledge and extended our heartfelt gratitude to Er. Mamta
Ma’am
who helped and encouraged us throughout
this journey.

we wish to express our thanks to all staff members of JMIT Radaur, who also helped us in
conducting this study.

Finally, we are particularly indebted to our dearest parents/guardians as without


their generous assistance and love; this project could never have been completed.

Thank You All For Everything.

Sanya (1219295)
Sanya Arora (1219296)

III
PREFACE

This project has been developed as the part of the Industrial training, which
Kurukshetra University requires its students to undergo, during the 4-6 week
industrial training in partial fulfilment of their Four–Year Bachelor of Technology
curriculum. The purpose of the Industrial Training is to familiarize the B.Tech
students with the present working environment of the country and how to utilize the
personal computer skills in different type of jobs. This training makes a person more
confident by how he can use his skills in the computer field.
There are a tremendous number of jobs in Computer field. One can get a good job
after B.Tech course and this training is helpful to them in every way. With the help of
this training the students have an opportunity to study the latest technical trends those

IV
have been established as well as those that are still developing. Moreover, to make
students feel sure that whatever they are learning during training would certainly help
them for their future course of action and help them to develop their potential and
technical skills. It allows them to explore various fields and to explore various fields
and to better equip themselves for a professional in new millennium.

COMPANY DETAILS

WHO WE ARE.
With the clear vision to provide premium services for mobile app & web development
for the clients who are serious about creating the next big mobile application
experience for their valuable customers. Contriverz is one of the top Transparent Web
Solutions company with the parallel mixture of experience, quality, dedication,
innovation and breakthrough in process of building.

Being the strong believers in the transformational power of technology, our strength
relies upon a large number of global client bases. Our clients believe in our talented
team of web designers, software developers, marketers, digital strategists, project
managers and business developers. Team Contriverz works in a collaborative manner
to generate excellent.

V
MISSION
Contriverz mission is to grow their customers business with the establishment for
them a digitalization platform. With creative designs and development services we
deliver high quality solutions that create value and reliable competitive advantage for
our clients around the world. Our mission is to deliver the best solutions with high
quality services at reasonable prices. Customer satisfaction is the first priority for us.
We are dealings in friendly manner with our customers, so it helps us to retain
existing clients and expand customer circle. By exploring innovative ideas, we always
try to improve the quality of our products.

VISION
When reconstructing a brand, you have to thoughtful of every aspect of information
which is presented to the consumers to ensure a successful reiteration of the brand.
We developed a brand color palate from which we assigned a color for each of
Recruit Me's activity tracks. This was was inspired from a multitude of tests that
scientifically-define the “Recruit Me” colors. When we paired this with a refined
logotype and thoughtful photography, the brand really started to come together.
WHY CONTRIVERZ ?
We don’t just protect sensitive data. Detection is key to successful security and
compliance efforts.
We’re focused on making cloud migration safe and simple.
We’re the only one-stop solution that safeguards sensitive data across all repositories,
on premises and in the cloud.
We deliver the most precise, real-time, sensitive data discovery solution in the market.
We build sensitive data governance simple, so you can easily focus on business
We’re committed to preparing you for the future.Also we’re the quickest and most
nimble provider around.

SERVICES
We are one-stop solution for Web and Mobile Application Development Services. At
contriverz, we have handled complexities, demands, specifications and challenges
with great care, passion and confidence.

VI
GRAPHIC DESIGN :
Contriverz is one the professionals graphic designers who made for our clients these
eye catching images. Our designers have the great imaginary power to create the
creative design with different color combination. We use different tools and
technologies to make a high quality design.

FRONTEND DEVELOPMENT :
Contriverz use the latest tools and techniques for developing useful web applications.
As a leading top IT company, we have delivered 100+ projects in different
technologies such as React, React Native, Angular, and Vue.js.

WEB / APPS DEVELOPMENT :


Contriverz handle every type of complex functionality and provide the desired
output. We have dedicated developers who have 12+ experience in desired technology
who solve each complex problem as per requirements..

TABLE OF CONTENT

TITTLE………………………………………………………………………………… i
CERTIFICATE...………………………………………………………………….…… ii
COMPANY DETAILS…………………………………………………………………. iii
PREFACE………………………………………………………………………………. vi
AKNOWLEDGEMENT……………………………………………………………….. vii
DECLARATION………………………………………………………………………. viii
TABLE OF CONTENT ………………………………………………………………. ix
LIST OF FIGURES…………………………………………………………………… xi
LIST OF TABLES…………………………………………………………………… xii

VII
Chapter 1:INTRODUCTION…………………………………………………………

1.1 PYTHON :THE PROGRAMMING LANGUAGE ………...…………………..... 13


1.2 PYTHON RELEASES……………………........……………………………….. 15
1.3 CHARACTERSTICS OF PYTHON…………........................................................... 16
Chapter 2: DATA TYPES AND OPERETORS……………………………………..
2.1 DATATYPE………………………………………………………………………… 21
2.2 VARIABLES……………………………………………....…….......................... 22
2.3 STRINGS…………………….……………………………………………………… 22
2.4 PYTHON OPERATORS …………………………………………………………. 23
Chapter 3: TUPLES AND LISTS…………………………………………………….
3.1 TUPLES……..………………………………………..………….............................. 25
3.2 BASIC TUPLE OPERATIONS…………………....................................................... 27
3.3 LIST……………………………………. ….…..…………........................................ 27
3.4 BUILT IN LIST FUNCTION & METHODS………………………......................... 30
Chapter 4: LOOPS AND FUNCTION………………………………………………..
4.1 LOOPS…………………………………………………………….……………… 31
4.2 TYPES OF LOOPS………………………………………………………………… 32
4.3 FUNCTION………………………………………………………………………….. 36
Chapter 5: SCOPE AND USES…………………….………………………………….
5.1 SCOPE OF PYHTON…………………………………………………….………. 38
5.2 USES OF PYHTON……………………………………………………………….. 39
Chapter 6: ALL ABOUT DJANGO…………………………………………………
6.1 INTRODUCTION TO DJANGO………………………………………………….
6.2 DJANGO – A WEB FRAMEWORK………………………………………………
6.3 WHY USE DJANGO…………………………………………………….
6.4 WORKING WITH DJANGO FORMS……………………………………………..
6.5 PRODUCTION WITH DJANGO…………………………………………………...
Chapter 7: INTRODUCTION TO WEB DEVELOPMENT
7.1 HTML………………………………………………………………………………...
7.2 CSS…………………………………………………………………………………...

VIII
7.3 JAVASCRIPT………………………………………………………………………..
PROJECT WORK…………………………………………………………………….
CONCLUSION………………………………………………………………………… 1

IX
LIST OF FIGURES

Figure No Figure Name Page No

1.0 Python logo 9

1.1 Basic Character 13

2.0 Python Data types 17

3.0 Python tuple 22

4.1 Loops 28

4.2 Conditional loops 31

4.3 Functions 34

5.1 Uses of Python 36

P.0 Project Output 40

X
LIST OF TABLES

Table No Table Name Page No

1.1 Comparison Table 14

2.1 Basic Operator 19

2.2 Comparison Operator 23

2.3 Logical Operator 14

3.1 Tuple Operations 22

3.2 List Functions 14

XI
CHAPTER 1

INTRODUCTION

1.1 PYTHON - THE PROGRAMMING LANGUAGE

Python is a widely used general-purpose, high level programming language. It was initially
designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was
mainly developed for emphasis on code readability, and its syntax allows programmers to
express concepts in fewer lines of code. Python is a programming language that lets you work
quickly and integrate systems more efficiently.

Figure 1.0 Python Logo

It is used for:

 Web development (server-side),

 Software development,

 Mathematics,

 System scripting.

12
What can Python do?

 Python can be used on a server to create web applications.


 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and modify files.
 Python can be used to handle big data and perform complex mathematics.
 Python can be used for rapid prototyping, or for production-ready software development.

Why Python?

 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer lines than some
other programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as it is
written. This means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a functional way.

Good to know

 The most recent major version of Python is Python 3, which is used to make this project.
However, Python 2, although not being updated with anything other than security
updates, is still quite popular.
 It is possible to write Python in a text editor or in an Integrated Development
Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly
useful when managing larger collections of Python files.

Python Syntax compared to other programming languages

 Python was designed for readability, and has some similarities to the English language
with influence from mathematics.
 Python uses new lines to complete a command, as opposed to other programming
languages which often use semicolons or parentheses.

13
 Python relies on indentation, using whitespace, to define scope; such as the scope of
loops, functions and classes. Other programming languages often use curly-brackets for
this purpose.

1.2 PYTHON RELAESES

PYTHON has different releases in different time of period. Different releases of pyhton are
given below with their release dates.

VERSIONS - DATE

Python 1.0 - January 1994

Python 1.5 - December 31, 1997

Python 1.6 - September 5, 2000

Python 2.0 - October 16, 2000

Python 2.1 - April 17, 2001

Python 2.2 - December 21, 2001

Python 2.3 - July 29, 2003

Python 2.4 - November 30, 2004

Python 2.5 - September 19, 2006

Python 2.6 - October 1, 2008

14
Python 2.7 - July 3, 2010

Python 3.0 - December 3, 2008

Python 3.1 - June 27, 2009

Python 3.2 - February 20, 2011

Python 3.3 - September 29, 2012

Python 3.4 - March 16, 2014

Python 3.5 - September 13, 2015

Python 3.6 - December 23, 2016

1.3 CHARACTERSTICS OF PYTHON

Interpreted Language: Python is processed at runtime by Python Interpreter

15
Figure 1.1 Basic Character

• Easy to read: Python source-code is clearly defined and visible to the eyes.

• Portable: Python codes can be run on a wide variety of hardware platforms having the same
interface.

• Extendable: Users can add low level-modules to Python interpreter.

• Scalable: Python provides an improved structure for supporting large programs than shell-
scripts.

• Object-Oriented Language: It supports object-oriented features and techniques of


programming.

• Interactive Programming Language: Users can interact with the python interpreter directly for
writing programs.

• Easy language: Python is easy to learn language especially for beginners.

• Straight forward Syntax: The formation of python syntax is simple and straightforward which
also makes it popular.

16
PYHTON VS OTHER LANGUAGE
Let us consider java language for the comparison:

Parameter Java Python


Compilation Java is a Compiled Language Python is an Interpreted Language
Static or
Java is statically typed Python is dynamically typed
Dynamic
String Offers limited string related It offers lots of string related
operations functions. functions.
Learning curve Complex learning curve Easy to learn and use
Multiple Multiple inheritances is partially It offers both single and multiple
inheritances done through interfaces. inheritances.
It uses curly braces to define the
Braces vs. Python uses indentation to separate
beginning and end of each
Indentation code into code blocks.
function and class definition.
Java program runs slowly Python programs run faster than
Speed
compared to Python. Java.
Python programs need an
Any computer or mobile device
interpreter installed on the target
which is able to run the Java
Portability machine to translate Python code.
virtual machine can run a Java
Compared to Java, Python is less
application
portable.
Java takes 10 lines of code to read
Read file Python only needs 2 lines of code.
from a file in Java.

17
Parameter Java Python
Java Virtual Machine provides the
For Python, the interpreter
runtime environment to execute
Architecture translates source code into
the code and convert bytecode
machine-independent bytecode.
into machine language.
Backend
Spring, Blade Django, Flask
Frameworks
Machine
Weka, Mallet, Deeplearning4j,
Learning Tensorflow. Pytorch.
MOA
Libraries
Game
Development JMonkeyEngine Cocos. Panda3d
Engines
Famous
companies Airbnb, Netflix, Spotify, Uber, Technologies, Dropbox,
using this Instagram. Google.
technology
 Great libraries
 Widely used  Readable code
 Excellent tooling  Rapid development
Best features
 Huge amount of  Beautiful code
documentation available.

Java is best for Desktop GUI Python is excellent for scientific


Best use for apps, Embed Systems, Web and numeric computing, Machine
application services, etc. learning apps, more.
Database
Java offers stable connectivity Python offers weak connectivity.
support

18
Parameter Java Python
class A {
public static void main(String args[]){
Hello World in Python:
System.out.println("Hello World");
Code example }
print "hello world";

TIOBE Rating 1 3
Companies Docker, Android SDK, Spring Django, Flask, Pycharm, CircleCI,
using it Boot, Senty,etc. etc.
The average salary for a Java The average salary for a Python
Salaries Developer is $103,464 per year in Developer is $118,626 per year in
the United States. the United States.

Table 1.1 Comparison Table

19
CHAPTER 2

DATA TYPES AND OPERATORS

2.1 Data Type

Data types determine whether an object can do something, or whether it just would not make
sense. Other programming languages often determine whether an operation makes sense for an
object by making sure the object can never be stored somewhere where the operation will be
performed on the object (this type system is called static typing). Python does not do that. Instead
it stores the type of an object with the object, and checks when the operation is performed
whether that operation makes sense for that object (this is called dynamic typing). Python has
many native data types.
Here are the important ones:
Booleans are either True or False.
Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions (1/2 and 2/3), or even complex
numbers.
Strings are sequences of Unicode characters, e.g. an HTML document.
Lists are ordered sequences of values.
Tuples are ordered, immutable sequences of values.
Sets are unordered bags of values.

20
Figure 2.0 Python Data types
2.2 Variable
Variables are nothing but reserved memory locations to store values. This means that when you
create a variable you reserve some space in memory.

Based on the data type of a variable, the interpreter allocates memory and decides what can be
stored in the reserved memory. Therefore, by assigning different data types to variables, you can
store integers, decimals or characters in these variables.

Ex:
counter = 100 # An integer assignment
miles = 1000.0 # A floating point
name = "John" # A string

2.3 String

In programming terms, we usually call text a string. When you think of a string as a collection
of letters, the term makes sense.
All the letters, numbers, and symbols in this book could be a string.
For that matter, your name could be a string, and so could your address.

21
Creating Strings

In Python, we create a string by putting quotes around text.


For example, we could take our otherwise useless

• "hello"+"world" "helloworld" # concatenation

• "hello"*3 "hellohellohello" # repetition

• "hello"[0] "h" # indexing

• "hello"[-1] "o" # (from end)

•"hello"[1:4] "ell" # slicing

• len("hello") 5 # size

2.4 Python Operator

Basic Operators

22
Table 2.1 Basic Operators

Comparison Operator

23
Table 2.2 Comparison Operator

Logical Operator

Table 2.3 Logical Operator

CHAPTER 3

24
TUPLES AND LISTS

3.1 Tuples

A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The
differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use
parentheses, whereas lists use square brackets.

Creating a tuple is as simple as putting different comma-separated values. Optionally you can put
these comma-separated values between parentheses also.

For example –

tup1 = ('physics', 'chemistry', 1997, 2000);

tup2 = (1, 2, 3, 4, 5 );

tup3 = "a", "b", "c", "d";

Accessing Values in Tuples:

To access values in tuple, use the square brackets for slicing along with the index or indices to
obtain value available at that index.

For example –

tup1 = ('physics', 'chemistry', 1997, 2000);

tup2 = (1, 2, 3, 4, 5, 6, 7 );

print "tup1[0]: ", tup1[0]

25
print "tup2[1:5]: ", tup2[1:5]

When the above code is executed, it produces the following result –

tup1[0]:

physics tup2[1:5]: [2, 3, 4, 5]

Figure 3.1 Python Tuples

3.2 Basic Tuples Operations

26
Tuples respond to the + and * operators much like strings; they mean concatenation and
repetition here too, except that the result is a new tuple, not a string. In fact, tuples respond to all
of the general sequence operations we used on strings in the prior chapter –

Table 3.1 Tuple Operations

3.3 List

The list is a most versatile datatype available in Python which can be written as a list of comma-
separated values (items) between square brackets.
Important thing about a list is that items in a list need not be of the same type.

Creating a list is as simple as putting different comma-separated values between square brackets.

For example –

list1 = ['physics', 'chemistry', 1997, 2000];

list2 = [1, 2, 3, 4, 5 ];

27
list3 = ["a", "b", "c", "d"];

Similar to string indices, list indices start at 0, and lists can be sliced, concatenated and so on.

Accessing Values in Lists:

To access values in lists, use the square brackets for slicing along with the index or indices to
obtain value available at that index.

For example –

list1 = ['physics', 'chemistry', 1997, 2000];

list2 = [1, 2, 3, 4, 5, 6, 7 ];

print "list1[0]: ", list1[0]

print "list2[1:5]: ", list2[1:5]

Output:

list1[0]:physics

list2[1:5]: [2, 3, 4, 5]

Update:

list = ['physics', 'chemistry', 1997, 2000];

print "Value available at index 2 : "

print list[2] list[2] = 2001; print "New value available at index 2 : "

28
print list[2]

Output:

Value available at index 2 : 1997

New value available at index 2 : 2001

Delete:

list1 = ['physics', 'chemistry', 1997, 2000];

print list1

del list1[2];

print "After deleting value at index 2 : "

print list1

['physics', 'chemistry', 1997, 2000]

Output:

After deleting value at index 2 :

['physics', 'chemistry', 2000]

29
3.4 Built-in List Functions & Methods:

Table 3.2 List functions

Python includes following list methods.

SN Methods with Description

1 list.append(obj) Appends object obj to list

2 list.count(obj) Returns count of how many times obj occurs in list

3 list.extend(seq) Appends the contents of seq to list

4 list.index(obj) Returns the lowest index in list that obj appears

5 list.insert(index, obj) Inserts object obj into list at offset index

6 list.pop(obj=list[-1]) Removes and returns last object or obj from list

7 list.remove(obj) Removes object obj from list

30
CHAPTER 4

LOOPS AND FUNCTIONS

4.1 LOOPS

Loops Programming languages provide various control structures that allow for more
complicated execution paths.

A loop statement allows us to execute a statement or group of statements multiple times. The
following diagram illustrates a loop statement –

Figure 4.1 Loops

31
Python programming language provides following types of loops to handle looping
requirements.

4.2 TYPES OF LOOPS :

While Loop : Repeats a statement or group of statements while a given condition is TRUE.
It tests the condition before executing the loop body.

For Loop : Executes a sequence of statements multiple times and abbreviates the code that
manages the loop variable.

Nested Loops : You can use one or more loop inside any another while, for or do..while loop.

Example:

While Loop:

>>> count = 0

>>> while (count < 4):

print 'The count is:', count

count = count + 1

OUTPUT:

The count is: 0

32
The count is: 1

The count is: 2

The count is: 3

For Loop:

>>> for mynum in [1, 2, 3, 4, 5]:

print "Hello", mynum

OUTPUT:

Hello 1

Hello 2

Hello 3

Hello 4

Hello 5

Conditional Statements:

Decision making is anticipation of conditions occurring while execution of the program and
specifying actions taken according to the conditions.

Decision structures evaluate multiple expressions which produce TRUE or FALSE as outcome.
You need to determine which action to take and which statements to execute if outcome is TRUE
or FALSE otherwise.

33
Figure 4.2 Conditional Loop

Python programming language provides following types of decision making statements.

if statements:

An if statement consists of a boolean expression followed by one or more statements.

if...else statements:

An if statement can be followed by an optional else statement, which executes when the boolean
expression is FALSE.

nested if statements:

You can use one if or else ifstatement inside another if or else ifstatement(s).

Example:

If Statement:
34
>>> state = “Texas”

>>> if state == “Texas”:

print “TX”

TX

If...Else Statement:

>>> if state == “Texas”

print “TX”

else:

print “[inferior state]”

If...Else...If Statement:

>>> if name == “Paige”

print “Hi Paige!”

elif

name == “Walker”:

print “Hi Walker!”

else: print “Imposter!”

35
4.3 Function

Function blocks begin with the keyword def followed by the function name and parentheses
( ( ) ). Any input parameters or arguments should be placed within these parentheses. You can
also define parameters inside these parentheses.

The first statement of a function can be an optional statement - the documentation string of the
function.

The code block within every function starts with a colon (:) and is indented.

The statement return [expression] exits a function, optionally passing back an expression to the
caller.

A return statement with no arguments is the same as return None.

Syntax

def functionname( parameters ):

"function_docstring"

function_suite

return [expression]

Figure 4.3 Functions

36
Example:

1. def printme( str ):


"This prints a passed string into this function"
print str
return

2. # Function definition is here


def printme( str ):
"This prints a passed string into this function"
print str
return;

# Now you can call printmefunction


printme("I'm first call to user defined function!")
printme("Again second call to the same function")

37
CHAPTER 5

SCOPE AND USES

5.1 Scope of Python

Science
– Bioinformatics

System Administration
-Unix
-Web logic
-Web sphere

Web Application Development


-CGI
Testing scripts

What Can We do With Python?

-System programming
-Graphical User Interface Programming
-Internet Scripting
-Component Integration

-Database Programming

-Gaming, Images, XML , Robot and more

38
5.2 Uses of Python : Who Uses Python Today?

 Python is being applied in real revenue-generating products by real companies.

 Google makes extensive use of Python in its web search system, and employs Python’s
creator.

 Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM use Python for hardware testing.

 ESRI uses Python as an end-user customization tool for its popular GIS mapping products.

 The YouTube video sharing service is largely written in Python.

Figure 5.1 Uses of Python

Why Do People Use Python?

The following primary factors cited by Python users seem to be these:

 Python is object-oriented

39
-Structure supports such concepts as polymorphism, operation overloading, and multiple
inheritance.

 Indentation o Indentation is one of the greatest future in Python.

 It's free (open source)

-Downloading and installing Python is free and easy o Source code is easily accessible

 It's powerful o Dynamic typing

-Built-in types and tools o Library utilities

-Third party utilities (e.g. Numeric, NumPy, SciPy)

-Automatic memory management

 It's portable

- Python runs virtually every major platform used today

-As long as you have a compatible Python interpreter installed, Python programs will run in
exactly the same manner, irrespective of platform.

40
CHAPTER 6

ALL ABOUT DJANGO

6.1 Introduction to Django

Django is a high-level Python web framework that encourages rapid development and clean,
pragmatic design. Built by experienced developers, it takes care of much of the hassle of web
development, so you can focus on writing your app without needing to reinvent the wheel. It’s
free and open source.

Django was born in 2003 in a press agency of Lawrence, Kansas. It is a web framework that uses
Python to create websites. Its goal is to write very fast dynamic websites. In 2005, the agency
decided to publish the Django source code in the BSD license. In 2008, the Django Software
Foundation was created to support and advance Django. Version 1.00 of the framework was
released a few months later.

Until 2013, Django was only compatible with Python version 2.x, but Django 1.5 released on
February 26, 2013, points towards the beginning of Python 3 compatibility. Today, big
organizations such as the Instagram mobile website, Mozilla.org, and Openstack.org are using
Django.

6.2 Django- a web framework

A framework is a set of software that organizes the architecture of an application and makes a
developer's job easier. A framework can be adapted to different uses. It also gives practical tools
to make a programmer's job faster. Thus, some features that are regularly used on a website can
be automated, such as database administration and user management. Once a programmer
handles a framework, it greatly improves their productivity and the code quality.

41
6.3 Why use Django ?

The following is a nonexhaustive list of the advantages of using Django:

• Django is published under the BSD license, which assures that web applications can be used
and modified freely without any problems; it's also free.

• Django is fully customizable. Developers can adapt to it easily by creating modules or


overridden framework methods.

• This modularity adds other advantages. There are a lot of Django modules that you can
integrate into Django. You can get some help with other people's work because you will often
find high-quality modules that you might need.

• Using Python in this framework allows you to have benefits from all Python libraries and
assures a very good readability.

• Django is a framework whose main goal is perfection. It was specifically made for people who
want clear code and a good architecture for their applications. It totally respects the Don't Repeat
Yourself (DRY) philosophy, which means keeping the code simple without having to copy/paste
the same parts in multiple places.

• With regards to quality, Django integrates lots of efficient ways to perform unit tests.

• Django is supported by a good community. This is a very important asset because it allows you
to resolve issues and fix bugs very fast. Thanks to the community, we can also find code
examples that show the best practices.

6.4 Working with Django Forms

Handling forms is a complex business. Consider Django’s admin, where numerous items of data
of several different types may need to be prepared for display in a form, rendered as HTML,
edited using a convenient interface, returned to the server, validated and cleaned up, and then
saved or passed on for further processing.

42
Django’s form functionality can simplify and automate vast portions of this work, and can also
do it more securely than most programmers would be able to do in code they wrote themselves.

Django handles three distinct parts of the work involved in forms:

 preparing and restructuring data to make it ready for rendering

 creating HTML forms for the data

 receiving and processing submitted forms and data from the client

It is possible to write code that does all of this manually, but Django can take care of it all for
you.

6.5 Production wih Django

When the development phase of a website is complete and you want to make it accessible to
users, you must deploy it. The following are the steps to do this:

• Completing the development

• Selecting the physical server

• Selecting the server software

• Selecting the server database

• Installing PIP and Python 3

• Installing PostgreSQL

• Installing Nginx

• Installing virtualenv and creating a virtual environment

• Installing Django, South, Gunicorn, and psycopg2

• Configuring PostgreSQL

• Adaptation of Work_manager to the production

43
Chapter 7 : Introduction to Web development

Web development is the building and maintenance of websites; it’s the work that happens behind
the scenes to make a website look great, work fast, and perform well with a seamless user
experience.

Web development is a broad term for the work involved in developing a web site for the Internet
(World Wide Web) or an intranet (a private network). Web development can range from
developing the simplest static single page of plain text to the most complex web- based internet
applications (or just ‘web apps’) electronic businesses, and social network services. A more
comprehensive list of tasks to which web development commonly refers, may include web
engineering, web design, web content development, client liaison, client- side/server-side
scripting, web server and network security configuration, and e- commerce development. Among
web professionals, “web development” usually refers to the main non-design aspects of building
web sites: writing markup and coding.

Web developers, or ‘devs’, do this by using a variety of coding languages. The languages they
use depends on the types of tasks they are performing and the platforms on which they are
working.

There are three primary languages used in web development and that are:

1. HTML (Hypertext Markup Language)


2. CSS (Cascading Style Sheet)
3. JS (JavaScript)

44
TOOLS

Introduction

The Translate and Edit application had been planned to consist of two parts-front-end and back-

end development. The front-end is the part of the web that you can see and interact with (e.g.,

Client-side programming). While front-end code interacts with the user in real time, the back-end

interacts with a server to return user ready results. The front-end is a combination of HTML,

CSS and JavaScript coding. By using JavaScript, modifications of the design of a web page can

be made immediately, however only temporary, and visible only by the user.

Normally the user would not have rights to modify web content dynamically on the server side.

Logically, administrators are the ones who deal with back-end modification of databases for

example, as they often contain sensitive data which should not be available to see or modify by

the general public. These front-end and back-end tools includes languages like HTML, CSS,

JavaScript, PHP, MYSQL etc. We will discuss all these languages in brief as given below.

45
HTML

Introduction

HTML (HyperText Mark-Up Language) is what is known as a "mark-up language"

whose role is to prepare written documents using formatting tags. The tags indicate

how the document is presented and how it links to other documents.

The World Wide Web (WWW for short), or simply the Web, is the worldwide

network formed by all the documents (called "web pages") which are connected to

one another by hyperlinks.

Web pages are usually organized around a main page, which acts as a hub for

browsing other pages with hyperlinks. This group of web pages joined by

hyperlinks and centered around a main page is called a website.

The Web is a vast living archive composed of a myriad of web sites, giving people

access

to web pages that may contain formatted text, images, sounds, video, etc.

Basic HTML structure

HTML is composed of eIements. These element’s structure the webpage and define its content.

A tag and the content between it is called an HTML element.


 
 HTML eIement (or simply, element) — a unit of content in an HTML document formed
by HTML tags and the text or media it contains.
46
 HTML Tag — the element name, surrounded by an opening (<) and cIosing (>) angle
bracket.
 Opening Tag — the first HTML tag used to start an HTML element. The tag type is
surrounded by opening and closing angIe brackets.
 Content — The information (text or other elements) contained between the opening and
closing tags of an HTML eIement.
 Closing tag — the second HTML tag used to end an HTML element. Closing tags have a
forward slash (/) inside of them, directly after the left angIe bracket.

What is the Web?


The Web is composed of web pages stored on web servers, which are machines
that are constantly connected to the Internet, and which provide the pages that
users request. Every web page, and more generally any online resource, such as
images, video, music, and animation, is associated with a unique address called a
URL. The key element for viewing web pages is the browser, a software program
which sends requests to web servers, then processes the resulting data and displays
the information as intended, based on instructions in the HTML page.

The most commonly used browsers on the Internet include:

➢ Mozilla Firefox,

➢ Microsoft Internet Explorer,

➢ Netscape Navigator,

➢ Safari

➢ Opera

HTML Tags

47
HTML tags are the building blocks of the website. HTML tags are the hidden

keywords within a web page that define how your web browser must format and

display the content.

Most tags must have two parts, an opening, and a closing part. For example,

<html> is the opening tag and </html> is the closing tag.

There are some tags that are an exception to this rule, and where a closing tag is

not required. The <img> tag for showing images is one example of this.

CSS

Introduction

48
The basic structure of every web page, HTML, is very plain on its own. The

beautiful websites that you see across the internet are styled with a variety of tools,

including CSS.

CSS, or Cascading Style Sheets, is a language that web developers use to style the

HTML content on a web page. If you’re interested in modifying colours, font

types, font sizes, shadows, images, element positioning, and more, CSS is the tool

for the job!

What Is CSS?

➢ CSS stands for Cascading Style Sheets.

➢ CSS describes how HTML elements are to be displayed on screen, paper, or in other media .

➢ CSS saves a lot of work. It can control the layout of multiple web pages all at once

➢ External stylesheets are stored in CSS files.

➢ CSS describes how HTML elements should be displayed.

➢ CSS Saves a Lot of Work! The style definitions are normally saved in external .css files.

➢ With an external stylesheet file, we can change the look of an entire website by changing just
one file! ➢ CSS can be either external or internal

CSS Syntax

49
A CSS rule-set consists of a selector and a declaration block:

CSS selector: The selector points to the HTML element you want to style.

The declaration block contains one or more declarations separated by semicolons.

Each declaration includes a CSS property name and a value, separated by a colon.

A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly
braces.

The External CSS can be declared in the required HTML page as:

<link rel="stylesheet" href="CSS_file_name “.css”>

The External CSS file is saved by using the .css extension, whereas the internal

CSS is saved in corresponding HTML file using the <style> tag. Using External

CSS is much better than using Internal.

Here are a few reasons this is better.

➢ Easier Maintenance

➢ Reduced File Size

➢ Reduced Bandwidth

➢ Improved Flexibility

CSS Comments

Comments are used to explain the code, and may help when you edit the

source code at a later date. Comments are ignored by browsers. A CSS

comment starts with /* and ends with */. Comments can also span multiple
lines.
Example-
.para1
{
50
text-align: center;
color:blue;
font-family: Jokerman; /*this is the single line comment */ }

In the example above, all HTML elements with class=para1" will be blue and center-aligned.

CSS Styles

➢ Background properties

➢ Border properties

➢ Padding

➢ Margin

➢ Color

➢ Font properties

➢ Text properties Link properties / Navigation bar properties

JAVASCRIPT

What is JavaScript?

51
JavaScript is an object-based scripting language that is lightweight and cross-

platform. JavaScript is not compiled but translated.

The JavaScript Translator (embedded in browser) is responsible to translate

the JavaScript code.

It is mainly used for:

➢ Client-side validation

➢ Dynamic drop-down menus.

➢ Displaying data and time.

➢ Displaying popup windows and dialog boxes (like alert dialog box, confirm dialog box and
prompt dialog box).

➢ Displaying clocks etc.

Example of JavaScript-
<h2>Welcome to JavaScript</h2>
<script>
document.write("Hello JavaScript by JavaScript");
</script>

Here, <script> tag is used to initialize the script and document.write() is a function used to write.
Like CSS, JavaScript also can be can be placed in:

1. Between the body tag of html


2. In .js file (external JavaScript)
3. Between the head tag of html

JavaScript Example: code between the body tag –


In the given example, we have displayed the dynamic content using

JavaScript. Let’s see the simple example of JavaScript that displays alert

dialog box.

<script type="text/javascript">
alert("Hello Javatpoint");
</script>

52
JavaScript Example : code in .JS file –

➢ message.js file

function msg()

alert("Hello Javatpoint");

➢ index.html

<head>
<script type="text/javascript" src="message.js"></script>
</head>
<body>
<p>Welcome to JavaScript</p>
<form>
<input type="button" value="click" onclick="msg()"/>
</form>
</body>

We can create external JavaScript file and embed it in many html page

It provides code re usability because single JavaScript file can be used in

several html pages.An external JavaScript file must be saved by .js extension.

It is recommended to embed all JavaScript files into a single file. It increases

the speed of the webpage.

Between the head tag of html

In the example given below, we are having a function msg() which is called.

To create a function, we use function name with keyword function.

For function call , we need to have an event.

53
Example-
<head>

<script type="text/javascript">

function msg()

alert("Hello Javatpoint");

</script>

</head>

<body>

<p>Welcome to JavaScript</p>

<form>

<input type="button" value="click" onclick="msg()"/>

</form>

</body>

Comments In JavaScript

The JavaScript comments are meaningful way to deliver message. It is used


to add information about the code, warnings or suggestions so that end user
can easily interpret the code. The JavaScript comment is ignored by the
JavaScript engine i.e. embedded in the browser.

Advantages of JavaScript comments

54
There are mainly two advantages of JavaScript comments.

➢ To make code easy to understand: It can be used to elaborate the code so that end user can
easily understand the code.

➢ To avoid the unnecessary code: It can also be used to avoid the code being executed.
Sometimes, we add the code to perform some action. But after some time, there may be need to
disable the code. In such case, it is better to use comments.

Example-
<script type="text/javascript">
function msg()
{
alert("Hello Javatpoint"); /* this is a comment*/
}
</script>

JavaScript Variable:
A JavaScript variable is simply a name of storage location. There are two
types of variables in JavaScript : local variable and global variable. There are
some rules while declaring a JavaScript variable (also known as identifiers).
➢ Name must start with a letter (a to z or A to Z), underscore( _ ), or dollar( $ ) sign.
➢ After first letter we can use digits (0 to 9), for example value1.
JavaScript variables are case sensitive, for example x and X are different variables.

JavaScript Functions

JavaScript functions are used to perform operations. We can call JavaScript


function many times to reuse the code.

Advantage of JavaScript function

There are mainly two advantages of JavaScript functions.

➢ Code reusability
➢ Less coding

55
JavaScript Function Syntax

The syntax of declaring function is given below.

function functionName([arg1, arg2, ...argN])

//code to be executed

JavaScript Functions can have 0 or more arguments.

Example-

<script>
function msg()
{
alert("hello! this is message");
}
</script>
<input type="button" onclick="msg()" value="call function"/>

Output of the above example:

hello! this is message

JavaScript Control Statements:

If-else:
It evaluates the content whether condition is true or false. The syntax of
JavaScript if-else statement is given below.

if(expression)
{
//content to be evaluated if condition is true

56
}
else
{
//content to be evaluated if condition is false
}

Example –

<script>
var a=20;
if(a%2==0)
{
document.write("a is even number");
}
else { document.write("a is odd number");
}
</script>

JavaScript Switch:

The JavaScript switch statement is used to execute one code from multiple
expressions. It is just like else if statement that we have learned in previous
page. But it is convenient than if..else..if because it can be used with numbers,
characters etc.The signature of JavaScript switch statement is given below.

switch(expression){
case value1:
code to be executed;
break;
case value2:
code to be executed;
break;
default: code to be executed if above values are not matched;
}
Applications of JavaScript:

Web Development: Adding interactivity and behavior to static sites

JavaScript was invented to do this in 1995. By using AngularJS that can be

achieved so easily.

57
Web Applications: With technology, browsers have improved to the extent
that a language was required to create robust web applications. When we
explore a map in Google Maps then we only need to click and drag the
mouse. All detailed view is just a click away, and this is possible only because
of JavaScript. It uses Application Programming Interfaces(APIs) that provide
extra power to the code. The Electron and React is helpful in this department.

Server Applications: With the help of Node.js, JavaScript made its way from client to server
and node.js is the most powerful on the server-side.

Games: Not only in websites, but JavaScript also helps in creating games for leisure. The
combination of JavaScript and HTML 5 makes JavaScript popular in game development as well.
It provides the EaseJS library which provides solutions for working with rich graphics.

Smartwatches: JavaScript is being used in all possible devices and applications. It provides a
library PebbleJS which is used in smartwatch applications. This framework works for
applications that require the internet for its functioning.

Art: Artists and designers can create whatever they want using JavaScript to draw on HTML 5
canvas, make the sound more effective also can be used p5.js library.

Machine Learning: This JavaScript ml5.js library can be used in web development by using
machine learning.

JavaScript is best known for web page development but it is also used in a variety of non-
browser environments.

PROJECT WORK

PROJECT NAME: BLOOD BANK MANAGEMENT SYSTEM.

PURPOSE:

A blood donation is a
process whereby a person
58
voluntarily has blood
drawn to be used
for future transfusions
when in need at hospitals
for treatment procedures
that
require them. Donation
may be of whole blood
(blood drawn directly from
the
body) or of specific
components of the blood;

59
such as red blood cells,
white blood
cells, plasma, and platelets.
Blood banks often
participate in the process of
collecting blood and other
procedures such as
managing stocks,
approving blood
requests and updating
donation information.
The inspiration of this
project is to improve blood
60
banks in Pakistan and to
develop a
blood bank information
system which focuses on
making an online system
that is
accessible for both donors
and administrators. Donors
can directly receive
information regarding their
previous blood donations,
including their blood
results
61
and donation history, in
order to easily schedule
their next donations. They
can
also update the personal
information through the
system, without having to
contact
the blood bank registry.
1
information if necessary.
The administrator is also

62
responsible for responding
to
the hospital’s blood
requests and checking the
stocks in the blood bank’s
inventory
The main aim of developing this system is to provide blood to the people who are
in need of blood. The number of persons who are in need of blood are increasing in
large number day by day. Using this system user can search blood group available
in the city and he can also get contact number of the donor who has the same blood
group he needs. In order to help people who are in need of blood, this Online
Blood Bank management system can be used effectively for getting the details of
available blood groups and user can also get contact number of the blood donors
having the same blood group and within the same city. So if the blood group is not
available in the blood bank user can request the donor to donate the blood to him
and save someone life. Using this bank management system people can register
himself or herself who want to donate blood. To register in the system they have to
enter their contact information like address mobile number etc.
This blood bank management system is an online website so it is easily available to
everyone. When a person want to donate blood he have to register to the system.
Donor registration is very easy, to get register to the system he have to fill up
registration form. After submitting the registration form he can create username
and password. Donor have to give information like blood group, contact details etc.
donor can also change his account information when he wants using his username
and password.
Using this blood bank system people can search blood group available which they
are needed. They check it online using our blood bank management website. If in

63
case blood group is not available in blood bank they can also get contact numbers
of the persons who has the same blood group he is need. And he can request the
person to donate the blood for saving someone life. Our system also allow user to
search online the person who have the same blood group he needs and if he find
the If he find a donor in his city then we give him all details of the donor, if he
doesn’t find any donor then he is given the contact numbers and addresses of the
Life Saving Contact Persons for big cities.

ADVANTAGES:

The people in need of blood can search for the donors by giving their blood group
and city name. it saves time as he can search donors online without going
anywhere. Using this system user can get blood in time and can save his relative or
friend life. Our website work 24x7 so user can get information of blood donor any
time. Blood donor can also get registered and save life of other person. The main
benefit of this system is the information of available blood group. When blood is
need in the operation then people have very less time to get the blood available so
if he get the information like who can give him blood in time in his city is life
saving. And here our system work, whenever a person need blood he get
information of the person who has the same blood group he needs.

64
SCREENSHOTS :

APPLICATIONS IN PROJECT :-

65
66
67
68
CONCLUSION

In the Above Report we have Acknowledged about the basics of Python. Python is
a dynamic, high level, free open source and interpreted programming language. It
supports object-oriented programming as well as procedural oriented
programming. In Python, we don’t need to declare the type of variable because it is
a dynamically typed language. Python has many more facilities and it is easy to
learn and can be identified by reading the code itself. The Basics we have learnt to
Code with Python mean that we are far more expressive as programmers. Good
programming is harnessing complexity by writing code that rhymes with our
intuitions. Good code is code that we can use with a minimal amount of context
and already be productive.
The two major advantages are: detail and complexity is hidden. We tackled the
basics of the Python programming language. This approach should be enough to

69
understand all the Basic Python examples. There is much more to learn about
programming using Python ... but this had given us a good start.

The Above Project is a Project that will Solve Problems that are based on the
Calculation or the basic Mathematical operations that take long time to execute.
The users only needs to put input with the desired operation they require to get out
the accurate Result.

70

You might also like