0% found this document useful (0 votes)
687 views131 pages

Farmer Information System Overview

This document provides an overview of a farmer information app that aims to help farmers sell their products online. The key features of the app include a dashboard with farm metrics, crop management tools, weather integration, market information, an educational resource library, and alerts/notifications. The app allows farmers to input crop details, access weather data, view market prices, and stay updated. It is intended to improve farmer productivity and connect them to buyers through e-commerce functions.

Uploaded by

prathiksha
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)
687 views131 pages

Farmer Information System Overview

This document provides an overview of a farmer information app that aims to help farmers sell their products online. The key features of the app include a dashboard with farm metrics, crop management tools, weather integration, market information, an educational resource library, and alerts/notifications. The app allows farmers to input crop details, access weather data, view market prices, and stay updated. It is intended to improve farmer productivity and connect them to buyers through e-commerce functions.

Uploaded by

prathiksha
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

FARMER INFORMATION APP FOR AGRICULTURE AND SALES

1
TABLE OF CONTENTS

CHAPTERS TITLE PAGE


NO
ABSTRACT

1 INTRODUCTION

1.1 OVERVIEW OF THE PROJECT 6

1.2 COMPANY PROFILE 10

2 SYSTEM SPECIFICATION

2.1 HARDWARE SPECIFICATION 16

2.2 SOFTWARE SPECIFICATION 16

2.3 SOFTWARE DESCRIPTION 17

3 SYSTEM STUDY

3.1 EXISTING SYSTEM 46

3.1.1 DRAWBACK OF EXISTING SYSTEM 46

3.2 PROPOSED SYSTEM 47

3.2.1 ADVANTAGE OF PROPOSED SYSTEM 47

4 REVIEW OF LITERATURE 49

5 SYSTEM DESIGN DEVELOPMENT 57

6 TESTING AND IMPLEMENTATION 72

7. CONCLUSION 82

8. APPENDIX 87-129

2
ABSTRACT

Farmer Information System is a web application developed for farmers. This application gives
suppose to the village farmers who want to use this facility and who want to learn how is it possible
and how they can use e-farming to sell their products. Farmers will get all the new ideas to improve
their productivity and they can buy and sell their products online. It is a project developed to build
a website which will help farmers from to sell their products to different cities through online.
Farmers can use this facility and can learn how is it possible and how they can use e-farming to sell
their products. Farmers enter this system and upload their product details with images whichever is
stocked at the warehouse and details of price, quality and etc. user view this product and book their
order. At last the products will be directly transported to the customers.

The key features of the Farmer Information Application include:

Dashboard: The application offers a visually appealing dashboard that provides an overview of the
farm's key metrics, such as crop status, weather conditions, pest alerts, and market prices. The
dashboard serves as a central hub for farmers to access important information quickly.

Crop Management: Farmers can input details about their crops, including crop type, planting date,
and expected harvest date. The application generates personalized recommendations on optimal
irrigation schedules, fertilization methods, and pest control strategies based on crop-specific data
and best practices.

Weather Integration: The application integrates with weather APIs to provide real-time weather
updates for the farmer's location. Farmers can monitor current weather conditions, receive
forecasts, and make informed decisions about irrigation, harvesting, and other activities based on
the weather data.

3
Market Information: The application aggregates market data from various sources, including
local markets and online platforms. Farmers can access current market prices for their crops,
identify demand trends, and plan their sales accordingly. This feature helps farmers maximize their
profitability by making informed pricing decisions.

Resource Library: The application includes a comprehensive resource library containing articles,
guides, and videos related to various farming techniques, crop diseases, pest control methods, and
more. Farmers can access this repository to gain knowledge, troubleshoot problems, and stay
updated with the latest advancements in agriculture.

Notifications and Alerts: The application sends timely notifications and alerts to farmers regarding
important events, such as upcoming rainfall, crop maturity, disease outbreaks, or price fluctuations
in the market. These notifications ensure that farmers stay informed and can take appropriate
actions promptly.

4
CHAPTER-I
INTRODUCTION

5
1. INTRODUCTION

1.1 OVERVIEW OF THE PROJECT

farmer Information System is a web application developed for Traders. This application gives
suppose to the village Traders who want to use this facility and who want to learn how is it possible
and how they can use e-former to sell their products. Traders will get all the new ideas to improve
their productivity and they can buy and sell their products online.
Purpose of Project

It is the agriculture portal which provides solutions to small farmers and agriculture students of In-
dia. Besides Salt & fertilizer analysis for particular region this portal also helps farmers to know
about government loan and insurance schemes. It also helps them make decisions on mandi/market
and best prices. NGOs are trying to spread messages to make agriculture more eco-friendly through
this site.
Scope of the project

This project deals with Besides Salt & fertilizer analysis for particular region this portal also helps
farmers to know about government loan and insurance schemes. It also helps them make decisions
on mandi/market and best prices. NGOs are trying to spread messages to make agriculture more
eco-friendly through this site.
PROJECT OVERVIEW
It is the agriculture portal which provides solutions to small farmers and agriculture students of In-
dia. Besides Salt & fertilizer analysis for particular region this portal also helps farmers to know
about government loan and insurance schemes. It also helps them make decisions on mandi/market
and best prices. NGOs are trying to spread messages to make agriculture more eco-friendly through
this site.
Entering the details of project, documents, and tasks manually is cumbersome, And tracking the
database is complicated when the details are maintained manually. This makes the maintenance of
schedule erroneous.

6
Administrator:
Admin maintain all the information about Agriculture officers details. It deals with the
creation of users and user maintenance . Every user willing to use the mail server application
should be existing as a user before they can send or receiving mails. Each user is needed to specify
the user name, password and date of creation .
A unique user-id is created or generated automatically and is associated with each user by
the system. The users password should not be displayed as they are typed. Users should be allowed
to change their password as and when required. The users can be deleted only by the administrator.
The admin user is by default created by the system and his password can be changed after he locks
in as admin. The list of users created can be viewed in a tabulated output.
Agriculture officers:
This module deals the information about all student details. And also maintain crops details,
fertilizer details, seeds details. And also maintains the interaction between agriculture students. And
takes comments from students.
A unique user-id is created or generated automatically and is associated with each user by
the system. The users password should not be displayed as they are typed. Users should be allowed
to change their password as and when required . The users can be deleted only by the administrator.
The admin user is by default created by the system and his password can be changed after he locks
in as admin. The list of users created can be viewed in a tabulated output.
.

7
MODULE SPECIFICATION
The modules of the project are: –

Login Module

Admin

Farmer

Vendor

Public

Login Module: –

This will help farmer/vendor/public to login into the system using id and password. A
farmer/vendor/public who has the valid id and password can only login to their respective accounts.
It will help the authentication of the farmer/vendor/public who enters the system.

Admin Module

Login: Admin login into the system using id and password.

Add Farming Information: He can add the forming details that is useful for farmers.

Add Market: He can add the market details. Farmer can search the different market in various
cities.

Reports: In this module generate reports like market , farmer information.

Farmer Module

login: The farmer can fill the registration form and get his credentials.

Add Product: All the details of the product will be uploaded by the farmer. He will fix the rates of
the products. He will add the details of the item. He can update the details of the item.

Orders: He can view the order details.

Search Market: He can search the different market in various cities.

Payment: He manage the payment details also.

Search Farming: Farmer can also gathering the useful farming information.

Vendor Module
8
Register: Vendor will get the username and password by filling the registration form. He will view
all the details of the product.

Search Farmer: He can search the former details also.

Order: He will see the list of products that he want to buy. He order the bulk of products.

Payment: He can view the sales rate details. The payment details managed by farmer and COD
mode.

Public Module

login: Public will get the username and password by filling the registration form.

Search Farmer: He will view all the details of the product. He can search the former details also.

Order For Function: He will see the list of products that he want to buy. He orders the bulk of
products for only function.

Payment: He can view the sales rate details. The payment details managed by farmer and COD
mode.

9
1.2 COMPANY PROFILE

SRI MILLENNIUM COMPUTER TECHNOLGIESS (SMC Technologiess) is a software and em-


bedded development company headquartered in India, Founded in 1995. We have been passion-
ately helping companies of all sizes across the globe accomplish their digital transformation goals.
We have been pioneers in adoption of the new technology in every new era be it Web Technology,
Embedded, PLC, Mobile, AI/ML and IoT. Using agile methods of working, we team up with busi-
nesses who want to turn ideas into reality, from the design of the software product, to development,
infrastructure, and scaling.

Our goal is to focus on your software and embedded product's unique requirements, enable teams
to learn and integrate the latest tools and languages, and work with your people to develop long-
lasting products. Expertise ranges from working in industries such as healthcare, logistics, ecom-
merce, and more.

SRI MILLENNIUM COMPUTER TECHNOLGIESS is a company built with people in mind both
in regards to the employees, clients, and end-users of the software solutions we develop.

Through a long history, we were always acting and making decisions analysing not just short-term
outcomes, but a potential long-term impact these decisions will have, putting all the efforts to keep
our business and living environment eco-, social-friendly and preserving the importance of human
rights.

We have assisted enterprises worldwide in digitalizing their business by offering end-to-end digital
solutions. We emphasize on the superiority and expediency of every solution that we develop to en-
sure enrichment of the clients’ business.

We employ some of the most talented IT professionals and continually invest into skills and know-
how development to ensure our clients enjoy the world-class solutions and service in the most cost-
effective way. Our commitment in every client engagement is to ensure success of customer’s in-
novations in IT-process and software systems.

10
OUR SERVICES:

Web Design

The logic of presentation is in the design philosophy. Web design company involves the strategic
planning of data mapping to the simple elegant stroke of a pattern. The best way to portray a
product or service of an organization kick starts with the website design. Representing the
mastermind of any sector in inspiring easy to ponder pattern!

Smc Technologies helps to enhance your business purview at the global level. Bits Informatics
creates a website that presents the strengths of your company under the following category:

 Self-portrayal website
 Interactive website
 Project centred website
 Service centred website
 Business to Business website
 Business to customer website

Web App Development

The system used for a structural execution or implementation of the business volume. In the gloom-
ing technological world, the time and space for planning, organizing, and execution of business
have become smarter. Smc Technologies helps their clients to overcome the technological needs of
the business. We are the technology experts to revamp the strategic business into smarter solutions.

Smc Technologies is the web app development company, it offers web-based application services
for the process based sector in cost-effective user-friendly versions. We are planning to work in
various sectors of business are:

 Educational Institutions
 Infrastructure Industries

11
 Manufacturing Industries

 Automobile Industries

 Hospitality Institutions

 Healthcare Organizations

 Logistics

 Product or Project Automation

Smc Technologies continuously explores the new business opportunities and sectors that look
towards systematic data performance.
The Growth of technology is never a barrier for the creative minds of innovation. The conglomer -
ates of business at one go is the latest technological trend and impact on the growth ratio. Bits In -
formatics creates a space for its clients to balance the time and efforts of their business hours with a
unique integration portfolio.

MOBILE APPLICATION

Smc Technologies aids to connect the client’s existing business with a mobile application. Bits In-

formatics do help the new client’s to build on their mobile application for m-commerce and web-

page. The various services offered through mobile application are:

 M-commerce

 Mobile UI Development

 Mobile Applications compatible to integrate the software/automation

 Mobile friendly webpage

 Mobile E-Publishing

Smc Technologies the technology partner thrives to enhance the client need for mobile application

services and solution.

12
DIGITAL MARKETING

The potential growth of the business relies on marketing strategies. The effective marketing plat-

form is the thumb rule for lead generations in any sector of businesses. Smc Technologies rejuve-

nates the client’s business by helping them to be the lead marketer of their sector.

Smc Technologies offers the following solutions to assist the client’s online marketing strategies:

 Search Engine Optimization

 Digital Marketing campaigns

 Social Media Marketing

 Web Analytics Services

 SEO copywriting

Smc Technologies the innovator and technology expertise on lead generations

13
MISSION
The company mission is to “Enhancing the business growth of our customers with creative
design and development to deliver market-defining high-quality solutions that create value and
reliable competitive advantage for our clients around the world”.
VISION
The company vision is to “develop in a constant manner and grow as a major IT service
provider to become a leading performer, in a providing quality web and software development
solutions in the competitive global marketplace.

14
CHAPTER-II
SYSTEM SPECIFICATION

15
2. SYSTEM SPECIFICATION

2.1 HARDWARE SPECIFICATION


The most common set of requirements defined by any operating system or
software application is the physical computer resources, also known as hardware, a
hardware requirements list is often accompanied by a hardware compatibility list
(HCL). An HCL lists tested, compatible, and sometimes incompatible hardware
devices for a particular operating system or application.
Processor : Intel Duel core
RAM : 2 GB
Hard Disk : 256 GB
2.2 SOFTWARE SPECIFICATION

It is a complete description of the behaviour of a system to be developed and It


includes a set of use cases that describe all the interactions the user will have with
the software. In addition to use cases, the SRS also contains non-functional
requirements.

Operating System : Windows 7 or Windows 10

Front End : Python with Django

Back End : SQLite Database

16
2.3 SOFTWARE DESCRIPTION

FRONT END: HTML,CSS

HTML

HTML was first created by Tim Berners-Lee, Robert Caillou, and others starting in 1989.
ItstandsforHyperTextMarkupLanguage.Hypertextmeansthatthedocumentcontains linksthat allow
the reader to jump to other places in the document or to another document altogether. The latest
version is known as HTML5. A Markup Language is a way that computers speak to each other to
control how text is processed and presented. To do this HTML uses two things: tags and at-
tributes.

HTML can embed programs written in a scripting language such as JavaScript, which af-
fects the behavior and content of web pages. Inclusion of CSS defines the look and layout of
content. The World Wide Web Consortium (W3C), former maintainer of the HTML and current
maintainer of the CSS standards, has encouraged the use of CSS over explicit presentational
HTML.

BENEFITS

The following are the advantages of HTML5

o Web pages development. HTML is heavily used for creating pages thatare
displayed on the world wideweb.
o Web document Creation.
o Internet navigation.
o Cutting edgefeature.
o Responsive images on webpages.
o Client-sidestorage.
o Offline capabilitiesusage.
o Data Entry support with HTML.

17
CSS

Cascading Style Sheets (CSS) is a style sheet language used for describing
the presentation of a document written in a markup language like HTML. CSS is a cornerstone
technology of the World Wide Web, alongside HTML andJavaScript.

CSS is designed to enable the separation of presentation and content, includ-


ing layout,colors, and fonts. This separation can improve content accessibility, provide moreflex-
ibilityandcontrolinthespecificationofpresentationcharacteristics,enablemultiplewebpages to share
formatting by specifying the relevant CSS in a separate .CSS file, and reduce complexity and
repetition in the structural content. Separation of formatting and content also makes it feasible to
present the same markup page in different styles for different rendering methods, such as on-
screen, in print, by voice (via speech-based browser or screen reader), and on Braille-based tac-
tile devices. The CSS specifications are maintained by the World Wide WebConsortium(W3C).

CSS Selectors

CSS selectors into five categories:

 Simple selectors (select elements based on name, id,class)

 Combinator selectors (select elements based on a specific relationship betweenthem)

 Pseudo-class selectors (select elements based on a certainstate)

 Pseudo-elements selectors (select and style a part of anelement)

 Attribute selectors (select elements based on an attribute or attributevalue)

18
PYTHON:

Python is a very popular general-purpose interpreted, interactive, object-oriented, and high-level


programming language. Python is dynamically-typed and garbage-collected programming
language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is
also available under the GNU General Public License (GPL).

Python supports multiple programming paradigms, including Procedural, Object Oriented and
Functional programming language. Python design philosophy emphasizes code readability with the
use of significant indentation.

This tutorial gives a complete understanding of Python programming language starting from basic
conceopts to advanced concepts. This tutorial will take you through simple and practical
approaches while learning Python Programming language.

Python Syntax compared to other programming languages

 Pythonwasdesignedforreadability,andhassomesimilaritiestotheEnglishlanguagewith influ-
ence from mathematics.
 Python uses new lines to complete a command, as opposed to other programming lan-
guages which often use semicolons or parentheses.
 Pythonreliesonindentation,usingwhitespace,todefinescope;suchasthescopeofloops, func-
tions and classes. Other programming languages often use curly-brackets for this purpose.

19
Python Online Compiler/Interpreter

We have provided Python Online Compiler/Interpreter which helps you to Edit and Execute the
code directly from your browser. Try to click the icon to run the following Python code to print
conventional "Hello, World!".

Below code box allows you to change the value of the code. Try to change the value
inside print() and run it again to verify the result.

# This is my first Python program.

# This will print 'Hello, World!' as the output

print ("Hello, World!");

Careers with Python

If you know Python nicely, then you have a great career ahead. Here are just a few of the career
options where Python is a key skill:

 Game developer
 Web designer
 Python developer
 Full-stack developer
 Machine learning engineer
 Data scientist
 Data analyst
 Data engineer
 DevOps engineer
 Software engineer
 Many more other roles

Characteristics of Python

Following are important characteristics of Python Programming −

20
 It supports functional and structured programming methods as well as OOP.
 It can be used as a scripting language or can be compiled to byte-code for building large ap-
plications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

Applications of Python

The latest release of Python is 3.x. As mentioned before, Python is one of the most widely used
language over the web. I'm going to list few of them here:

 Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax.
This allows the student to pick up the language quickly.
 Easy-to-read − Python code is more clearly defined and visible to the eyes.
 Easy-to-maintain − Python's source code is fairly easy-to-maintain.
 A broad standard library − Python's bulk of the library is very portable and cross-platform
compatible on UNIX, Windows, and Macintosh.
 Interactive Mode − Python has support for an interactive mode which allows interactive
testing and debugging of snippets of code.
 Portable − Python can run on a wide variety of hardware platforms and has the same inter-
face on all platforms.
 Extendable − You can add low-level modules to the Python interpreter. These modules en-
able programmers to add to or customize their tools to be more efficient.
 Databases − Python provides interfaces to all major commercial databases.
 GUI Programming − Python supports GUI applications that can be created and ported to
many system calls, libraries and windows systems, such as Windows MFC, Macintosh, and
the X Window system of Unix.
 Scalable − Python provides a better structure and support for large programs than shell
scripting.

21
The Python syntax defines a set of rules that are used to create Python statements while writing a
Python Program. The Python Programming Language Syntax has many similarities to Perl, C, and
Java Programming Languages. However, there are some definite differences between the
languages.

First Python Program

Let us execute a Python "Hello, World!" Programs in different modes of programming.

Python - Interactive Mode Programming

We can invoke a Python interpreter from command line by typing python at the command prompt
as following −

$ python
Python 3.6.8 (default, Sep 10 2021, 09:13:53)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Here >>> denotes a Python Command Prompt where you can type your commands. Let's type the
following text at the Python prompt and press the Enter −

>>> print ("Hello, World!")

If you are running older version of Python, like Python 2.4.x, then you would need to use print
statement without parenthesis as in print "Hello, World!". However in Python version 3.x, this
produces the following result −

Hello, World!
Python - Script Mode Programming

We can invoke the Python interpreter with a script parameter which begins the execution of the
script and continues until the script is finished. When the script is finished, the interpreter is no
longer active.

Let us write a simple Python program in a script which is simple text file. Python files have
extension .py. Type the following source code in a test.py file −

22
print ("Hello, World!")

We assume that you have Python interpreter path set in PATH variable. Now, let's try to run this
program as follows −

$ python test.py

This produces the following result −

Hello, World!

Let us try another way to execute a Python script. Here is the modified test.py file −

#!/usr/bin/python

print ("Hello, World!")

We assume that you have Python interpreter available in /usr/bin directory. Now, try to run this
program as follows −

$ chmod +x test.py # This is to make file executable


$./test.py

This produces the following result −

Hello, World!

Python Identifiers

A Python identifier is a name used to identify a variable, function, class, module or other object. An
identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters,
underscores and digits (0 to 9).

Python does not allow punctuation characters such as @, $, and % within identifiers.

Python is a case sensitive programming language. Thus, Manpower and manpower are two
different identifiers in Python.

Here are naming conventions for Python identifiers −

 Python Class names start with an uppercase letter. All other identifiers start with a lowercase
letter.
23
 Starting an identifier with a single leading underscore indicates that the identifier
is private identifier.
 Starting an identifier with two leading underscores indicates a strongly private identifier.
 If the identifier also ends with two trailing underscores, the identifier is a language-
defined special name.

Python Reserved Words

The following list shows the Python keywords. These are reserved words and you cannot use them
as constant or variable or any other identifier names. All the Python keywords contain lowercase
letters only.

and as assert

break class continue

def del elif

else except False

finally for from

global if import

in is lambda

None nonlocal not

or pass raise

return True try

while with yield

Python Lines and Indentation

Python programming provides no braces to indicate blocks of code for class and function
definitions or flow control. Blocks of code are denoted by line indentation, which is rigidly

24
enforced.

The number of spaces in the indentation is variable, but all statements within the block must be
indented the same amount. For example −

if True:

print ("True")

else:

print ("False")

However, the following block generates an error −

if True:

print ("Answer")

print ("True")

else:

print ("Answer")

print ("False")

Thus, in Python all the continuous lines indented with same number of spaces would form a block.
The following example has various statement blocks −

Do not try to understand the logic at this point of time. Just make sure you understood various
blocks even if they are without braces.

import sys

try:

# open file stream

file = open(file_name, "w")

except IOError:

print "There was an error writing to", file_name

sys.exit()
25
print "Enter '", file_finish,

print "' When finished"

while file_text != file_finish:

file_text = raw_input("Enter text: ")

if file_text == file_finish:

# close the file

file.close

break

file.write(file_text)

file.write("\n")

file.close()

file_name = raw_input("Enter filename: ")

if len(file_name) == 0:

print "Next time please enter something"

sys.exit()

try:

file = open(file_name, "r")

except IOError:

print "There was an error reading file"

sys.exit()

file_text = file.read()

file.close()

print file_text

Python Multi-Line Statements

Statements in Python typically end with a new line. Python does, however, allow the use of the line
26
continuation character (\) to denote that the line should continue. For example −

total = item_one + \

item_two + \

item_three

Statements contained within the [], {}, or () brackets do not need to use the line continuation
character. For example following statement works well in Python −

days = ['Monday', 'Tuesday', 'Wednesday',

'Thursday', 'Friday']

Quotations in Python

Python accepts single ('), double (") and triple (''' or """) quotes to denote string literals, as long as
the same type of quote starts and ends the string.

The triple quotes are used to span the string across multiple lines. For example, all the following
are legal −

word = 'word'

sentence = "This is a sentence."

paragraph = """This is a paragraph. It is

made up of multiple lines and sentences."""

Comments in Python

A comment is a programmer-readable explanation or annotation in the Python source code. They


are added with the purpose of making the source code easier for humans to understand, and are
ignored by Python interpreter

Just like most modern languages, Python supports single-line (or end-of-line) and multi-line (block)
comments. Python comments are very much similar to the comments available in PHP, BASH and
Perl Programming languages.

27
A hash sign (#) that is not inside a string literal begins a comment. All characters after the # and up
to the end of the physical line are part of the comment and the Python interpreter ignores them.

# First comment

print ("Hello, World!") # Second comment

This produces the following result −

Hello, World!

You can type a comment on the same line after a statement or expression −

name = "Madisetti" # This is again comment

You can comment multiple lines as follows −

# This is a comment.

# This is a comment, too.

# This is a comment, too.

# I said that already.

Following triple-quoted string is also ignored by Python interpreter and can be used as a multiline
comments:

'''

This is a multiline

comment.

'''

Using Blank Lines in Python Programs

A line containing only whitespace, possibly with a comment, is known as a blank line and Python
totally ignores it.

In an interactive interpreter session, you must enter an empty physical line to terminate a multiline
statement.

28
Waiting for the User

The following line of the program displays the prompt, the statement saying “Press the enter key to
exit”, and waits for the user to take action −

#!/usr/bin/python

raw_input("\n\nPress the enter key to exit.")

Here, "\n\n" is used to create two new lines before displaying the actual line. Once the user presses
the key, the program ends. This is a nice trick to keep a console window open until the user is done
with an application.

Multiple Statements on a Single Line

The semicolon ( ; ) allows multiple statements on the single line given that neither statement starts
a new code block. Here is a sample snip using the semicolon −

import sys; x = 'foo'; sys.stdout.write(x + '\n')

Multiple Statement Groups as Suites

A group of individual statements, which make a single code block are called suites in Python.
Compound or complex statements, such as if, while, def, and class require a header line and a suite.

Header lines begin the statement (with the keyword) and terminate with a colon ( : ) and are
followed by one or more lines which make up the suite. For example −

if expression :

suite

elif expression :

suite

else :

suite

Command Line Arguments in Python

Many programs can be run to provide you with some basic information about how they should be
29
run. Python enables you to do this with -h −

$ python -h
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-c cmd : program passed in as string (terminates option list)
-d : debug output from parser (also PYTHONDEBUG=x)
-E : ignore environment variables (such as PYTHONPATH)
-h : print this help message and exit

[ etc. ]

You can also program your script in such a way that it should accept various options. Command
Line Arguments is an advanced topic and should be studied a bit later once you have gone through
rest of the Python concepts.

DJANGO (WEB FRAMEWORK)

Django isaPython-basedfreeandopen-sourcewebframework,whichfollowsthemodel- tem-


plate-view (MTV) architecturalpattern.
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,soyoucanfocusonwritingyourappwithoutneedingtoreinventthewheel.It‟sfree and
opensource.
The model layers
Django provides an abstraction layer (the “models”) for structuring and manipulating the data of
your Web application. Learn more about it below:

 Models: Introduction to models, Field types, Indexes, Meta options, Modelclass


 Query Sets: Making queries, Query Set method reference, Lookupexpressions
 Model instances: Instance methods, Accessing related objects
 Migrations: Introduction to Migrations, Operations reference, Schema Editor, Writing
migrations

30
Key features of the Django framework include:

Object-Relational Mapping (ORM): Django provides an ORM that enables developers to in-
teract with the database using Python code instead of writing raw SQL queries. It supports
multiple database backends and simplifies database operations, including querying, data in-
sertion, and updates.

URL Routing: Django's URL routing mechanism allows developers to map URLs to views
and functions in the application. It enables clean and customizable URLs, making the appli-
cation's structure more readable and user-friendly.

Template Engine: Django includes a powerful template engine that separates the presentation
logic from the business logic. Developers can create dynamic HTML templates with built-in
template tags and filters, allowing for code reuse and maintainability.

Authentication and Authorization: Django provides a robust authentication system, handling


user registration, login, and password management out of the box. It also supports authoriza-
tion and permission-based access control to different parts of the application.

Form Handling: Django simplifies form handling by providing a forms module. It allows de-
velopers to define and validate forms using Python classes, automating tasks like data valida-
tion, error handling, and displaying form fields.

Admin Interface: Django offers an administration interface automatically generated based on


the application's models. It provides a user-friendly interface for managing database records,
handling CRUD (Create, Read, Update, Delete) operations, and configuring models.

Security Features: Django includes several security features to protect web applications from
common vulnerabilities. It provides protection against cross-site scripting (XSS), cross-site
request forgery (CSRF), and SQL injection attacks.

31
Internationalization and Localization: Django supports internationalization and localization,
allowing developers to build applications that can be easily translated into different languages
and localized for various regions.

Testing Framework: Django provides a testing framework that helps developers write unit
tests and integration tests for their applications. It simplifies the process of writing test cases
and running tests to ensure the application's stability and reliability.

Extensibility: Django is highly extensible, allowing developers to integrate third-party li-


braries, customize behavior, and build reusable components called "apps." It has a vibrant
ecosystem with numerous packages and extensions available for various functionalities.

Model:

The model provides data from the database.

In Django, the data is delivered as an Object Relational Mapping (ORM), which is a technique
designed to make it easier to work with databases.

The most common way to extract data from a database is SQL. One problem with SQL is that you
have to have a pretty good understanding of the database structure to be able to work with it.

Django, with ORM, makes it easier to communicate with the database, without having to write
complex SQL statements.

The models are usually located in a file called models.py.

32
BACKEND: SQLite

SQLite

SQLite is an in-process library that implements a self-contained, serverless, zero-


configuration, transactional SQL database engine. The code for SQLite is in the public domain and
is thus free for use for any purpose, commercial or private. SQLite is the most widely
deployed database in the world with more applications than we can count, including several high-
profile projects.

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not
have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete
SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.
The database file format is cross-platform - you can freely copy a database between 32-bit and 64-
bit systems or between big-endian and little-endian architectures. These features make SQLite a
popular choice as an Application File Format. SQLite database files are a recommended storage
format by the US Library of Congress. Think of SQLite not as a replacement for Oracle but as a
replacement for fopen()

SQLite is a compact library. With all features enabled, the library size can be less than 750KiB,
depending on the target platform and compiler optimization settings. (64-bit code is larger. And
some compiler optimizations such as aggressive function inlining and loop unrolling can cause the
object code to be much larger.) There is a tradeoff between memory usage and speed. SQLite
generally runs faster the more memory you give it. Nevertheless, performance is usually quite good
even in low-memory environments. Depending on how it is used, SQLite can be faster than direct
filesystem I/O.

SQLite is very carefully tested prior to every release and has a reputation for being very reliable.
Most of the SQLite source code is devoted purely to testing and verification. An automated test
suite runs millions and millions of test cases involving hundreds of millions of individual SQL
statements and achieves 100% branch test coverage. SQLite responds gracefully to memory
allocation failures and disk I/O errors. Transactions are ACID even if interrupted by system crashes
or power failures. All of this is verified by the automated tests using special test harnesses which
33
simulate system failures. Of course, even with all this testing, there are still bugs. But unlike some
similar projects (especially commercial competitors) SQLite is open and honest about all bugs and
provides bugs lists and minute-by-minute chronologies of code changes.

The SQLite code base is supported by an international team of developers who work on SQLite
full-time. The developers continue to expand the capabilities of SQLite and enhance its reliability
and performance while maintaining backwards compatibility with the published interface
spec, SQL syntax, and database file format. The source code is absolutely free to anybody who
wants it, but professional support is also available.

The SQLite project was started on 2000-05-09. The future is always hard to predict, but the intent
of the developers is to support SQLite through the year 2050. Design decisions are made with that
objective in mind.

We the developers hope that you find SQLite useful and we entreat you to use it well: to make good
and beautiful products that are fast, reliable, and simple to use. Seek forgiveness for yourself as you
forgive others. And just as you have received SQLite for free, so also freely give, paying the debt
forward.

SQLite - Commands

This chapter will take you through simple and useful commands used by SQLite programmers.
These commands are called SQLite dot commands and exception with these commands is that they
should not be terminated by a semi-colon (;).

Let's start with typing a simple sqlite3 command at command prompt which will provide you with
SQLite command prompt where you will issue various SQLite commands.

$sqlite3
SQLite version 3.3.6
Enter ".help" for instructions
sqlite>

For a listing of the available dot commands, you can enter ".help" any time. For example −

sqlite>.help

34
SQLite - Syntax

SQLite is followed by unique set of rules and guidelines called Syntax. This chapter lists all
the basic SQLite Syntax.

Case Sensitivity

The important point to be noted is that SQLite is case insensitive, i.e. the
clauses GLOB and glob have the same meaning in SQLite statements.

Comments

SQLite comments are extra notes, which you can add in your SQLite code to increase its
readability and they can appear anywhere; whitespace can occur, including inside expressions
and in the middle of other SQL statements but they cannot be nested.

SQL comments begin with two consecutive "-" characters (ASCII 0x2d) and extend up to and
including the next newline character (ASCII 0x0a) or until the end of input, whichever comes
first.

You can also use C-style comments, which begin with "/*" and extend up to and including the
next "*/" character pair or until the end of input, whichever comes first. C-style comments
can span multiple lines.

sqlite> .help -- This is a single line comment

SQLite Statements

All the SQLite statements start with any of the keywords like SELECT, INSERT, UPDATE,
DELETE, ALTER, DROP, etc., and all the statements end with a semicolon (;).

SQLite ANALYZE Statement


ANALYZE;

or
ANALYZE database_name;

or
ANALYZE database_name.table_name;

35
SQLite AND/OR Clause
SELECT column1, column2....columnN
FROM table_name
WHERE CONDITION-1 {AND|OR} CONDITION-2;

SQLite ALTER TABLE Statement


ALTER TABLE table_name ADD COLUMN column_def...;

SQLite ALTER TABLE Statement (Rename)


ALTER TABLE table_name RENAME TO new_table_name;

SQLite ATTACH DATABASE Statement


ATTACH DATABASE 'DatabaseName' As 'Alias-Name';

SQLite BEGIN TRANSACTION Statement


BEGIN;
or
BEGIN EXCLUSIVE TRANSACTION;

SQLite BETWEEN Clause


SELECT column1, column2....columnN
FROM table_name
WHERE column_name BETWEEN val-1 AND val-2;

SQLite COMMIT Statement


COMMIT;

SQLite CREATE INDEX Statement


CREATE INDEX index_name
ON table_name ( column_name COLLATE NOCASE );

SQLite CREATE UNIQUE INDEX Statement


CREATE UNIQUE INDEX index_name
ON table_name ( column1, column2,...columnN);

SQLite CREATE TABLE Statement


CREATE TABLE table_name(

column1 datatype,

36
column2 datatype,

column3 datatype,

.....
columnN datatype,

PRIMARY KEY( one or more columns )


);

SQLite CREATE TRIGGER Statement


CREATE TRIGGER database_name.trigger_name
BEFORE INSERT ON table_name FOR EACH ROW
BEGIN
stmt1;

stmt2;

....
END;

SQLite CREATE VIEW Statement


CREATE VIEW database_name.view_name AS

SELECT statement....;

SQLite CREATE VIRTUAL TABLE Statement


CREATE VIRTUAL TABLE database_name.table_name USING weblog( access.log );
or
CREATE VIRTUAL TABLE database_name.table_name USING fts3( );

SQLite COMMIT TRANSACTION Statement


COMMIT;

SQLite COUNT Clause


SELECT COUNT(column_name)
FROM table_name
WHERE CONDITION;

SQLite DELETE Statement


DELETE FROM table_name
WHERE {CONDITION};

37
SQLite DETACH DATABASE Statement
DETACH DATABASE 'Alias-Name';

SQLite DISTINCT Clause


SELECT DISTINCT column1, column2....columnN

FROM table_name;

SQLite DROP INDEX Statement


DROP INDEX database_name.index_name;

SQLite DROP TABLE Statement


DROP TABLE database_name.table_name;

SQLite DROP VIEW Statement


DROP INDEX database_name.view_name;

SQLite DROP TRIGGER Statement


DROP INDEX database_name.trigger_name;

SQLite EXISTS Clause


SELECT column1, column2....columnN
FROM table_name
WHERE column_name EXISTS (SELECT * FROM table_name );

SQLite EXPLAIN Statement


EXPLAIN INSERT statement...;

or
EXPLAIN QUERY PLAN SELECT statement...;

SQLite GLOB Clause


SELECT column1, column2....columnN
FROM table_name
WHERE column_name GLOB { PATTERN };

SQLite GROUP BY Clause


SELECT SUM(column_name)
FROM table_name
WHERE CONDITION
GROUP BY column_name;

38
SQLite HAVING Clause
SELECT SUM(column_name)
FROM table_name
WHERE CONDITION
GROUP BY column_name
HAVING (arithematic function condition);

SQLite INSERT INTO Statement


INSERT INTO table_name( column1, column2....columnN)

VALUES ( value1, value2....valueN);

SQLite IN Clause
SELECT column1, column2....columnN
FROM table_name
WHERE column_name IN (val-1, val-2,...val-N);

SQLite Like Clause


SELECT column1, column2....columnN
FROM table_name
WHERE column_name LIKE { PATTERN };

SQLite NOT IN Clause


SELECT column1, column2....columnN
FROM table_name
WHERE column_name NOT IN (val-1, val-2,...val-N);

SQLite ORDER BY Clause


SELECT column1, column2....columnN
FROM table_name
WHERE CONDITION
ORDER BY column_name {ASC|DESC};

SQLite PRAGMA Statement


PRAGMA pragma_name;

For example:

PRAGMA page_size;

39
PRAGMA cache_size = 1024;
PRAGMA table_info(table_name);

SQLite RELEASE SAVEPOINT Statement


RELEASE savepoint_name;

SQLite REINDEX Statement


REINDEX collation_name;

REINDEX database_name.index_name;

REINDEX database_name.table_name;

SQLite ROLLBACK Statement


ROLLBACK;

or
ROLLBACK TO SAVEPOINT savepoint_name;

SQLite SAVEPOINT Statement


SAVEPOINT savepoint_name;

SQLite SELECT Statement


SELECT column1, column2....columnN

FROM table_name;

SQLite UPDATE Statement


UPDATE table_name
SET column1 = value1, column2 = value2....columnN=valueN
[ WHERE CONDITION ];

SQLite VACUUM Statement


VACUUM;

SQLite WHERE Clause


SELECT column1, column2....columnN
FROM table_name
WHERE CONDITION;

40
Django Introduction

Django is a Python framework that makes it easier to create web sites using Python.

Django takes care of the difficult stuff so that you can concentrate on building your web
applications.

Django emphasizes reusability of components, also referred to as DRY (Don't Repeat


Yourself), and comes with ready-to-use features like login system, database connection and
CRUD operations (Create Read Update Delete).

Django follows the MVT design pattern (Model View Template).

 Model - The data you want to present, usually data from a database.
 View - A request handler that returns the relevant template and content - based on the
request from the user.
 Template - A text file (like an HTML file) containing the layout of the web page, with
logic on how to display the data.

Model

The model provides data from the database.

In Django, the data is delivered as an Object Relational Mapping (ORM), which is a


technique designed to make it easier to work with databases.

The most common way to extract data from a database is SQL. One problem with SQL is that
you have to have a pretty good understanding of the database structure to be able to work
with it.

Django, with ORM, makes it easier to communicate with the database, without having to
write complex SQL statements.

The models are usually located in a file called models.py.

41
View

A view is a function or method that takes http requests as arguments, imports the relevant
model(s), and finds out what data to send to the template, and returns the final result.

The views are usually located in a file called views.py.

Template

A template is a file where you describe how the result should be represented.

Templates are often .html files, with HTML code describing the layout of a web page, but it
can also be in other file formats to present other results, but we will concentrate on .html
files.

Django uses standard HTML to describe the layout, but uses Django tags to add logic:

<h1>My Homepage</h1>

<p>My name is {{ firstname }}.</p>

The templates of an application is located in a folder named templates.

URLs

Django also provides a way to navigate around the different pages in a website.

When a user requests a URL, Django decides which view it will send it to.

This is done in a file called urls.py.

When you have installed Django and created your first Django web application, and the
browser requests the URL, this is basically what happens:

1. Django receives the URL, checks the urls.py file, and calls the view that matches
the URL.
2. The view, located in views.py, checks for relevant models.
42
3. The models are imported from the models.py file.
4. The view then sends the data to a specified template in the template folder.
5. The template contains HTML and Django tags, and with the data it returns finished
HTML content back to the browser.

Django can do a lot more than this, but this is basically what you will learn in this tutorial,
and are the basic steps in a simple web application made with Django.

Django Requires Python

To check if your system has Python installed, run this command in the command prompt:

python --version

If Python is installed, you will get a result with the version number, like this

Python 3.9.2

If you find that you do not have Python installed on your computer, then you can download it
for free from the following website: https://www.python.org/

PIP

To install Django, you must use a package manager like PIP, which is included in Python
from version 3.4.

To check if your system has PIP installed, run this command in the command prompt:

pip --version

If PIP is installed, you will get a result with the version number.

For me, on a windows machine, the result looks like this:

pip 20.2.3 from c:\python39\lib\site-packages\pip (python 3.9)

If you do not have PIP installed, you can download and install it from this
page: https://pypi.org/project/pip/

43
Virtual Environment

It is suggested to have a dedicated virtual environment for each Django project, and one way
to manage a virtual environment is venv, which is included in Python.

The name of the virtual environment is your choice, in this tutorial we will call it myworld.

Type the following in the command prompt, remember to navigate to where you want to
create your project:

Windows:

py -m venv myworld

Unix/MacOS:

python -m venv myworld

This will set up a virtual environment, and create a folder named "myworld" with subfolders
and files, like this:

myworld
Include
Lib
Scripts
pyvenv.cfg

Then you have to activate the environment, by typing this command:

Windows:

myworld\Scripts\activate.bat

Unix/MacOS:

source myworld/bin/activate
Django is a web framework used for rapid development with a clean, pragmatic, maintain-
able, and secure design. It is open-source and written in Python. A web application frame-
work is a toolkit of all components needed for application development. The main goal of the

44
Django framework is to allow developers to focus on new components of the application in-
stead of spending time on already developed components. Many other frameworks on the
market have fewer features than it. It takes care of a lot of hassle. Involved in web develop -
ment, users can focus on developing components needed for their application.

45
CHAPTER-III
SYSTEM STUDY

46
3. SYSTEM STUDY

3.1 Existing System


In existing system-shopping can done in a manual way, the customer has to go for
shopping, and then he is having the possibility to choose the products whatever he wants.
The existing system buying and selling a product is done a time consuming process. In
manually. The seller fixes Price of the product. All the details of the product to be sold or
purchased is maintained manually. Sellers or buyers not able to get the complete
information about the product.
Less variety is available for customers. This is due to the limitation of retail space
available to the retailer. Comparative purchase is not made easy. Customers miss out
heavy discounts that are generally offered by online marketers. Thus, if customers care for
money then is would be best to opt for online shopping. If customers are more concerned
of after sales service then they should opt for offline shopping. Going from one shop to
another can be exhausting and time consuming. Sometimes malls and markets are so
crowded that you can barely walk.

3.1.1 Drawback of Existing system


 In Existing System the Customer is completely depending on the manual (that
means can use by the system or some software)process for buying the products.
 Manual process is a time consuming factor. And when customer approaches for a
manual shopping directly, actually he/she does not have an idea about things like,
price range, items, etc.,
 The time, which has been spent by the customer in manual shopping can, equates
to multiple number of shopping. As customer can sit at home and browse in a
fraction of seconds.
 Thus we need to change to a system like “Farmer information app for sales “

47
3.2 Proposed System
 Online stores are usually available 24 hours a day, and many consumers have Internet
access both at work and at home.
 Other establishments such as internet cafes and schools provide access as well. A visit
to a conventional retail store requires travel and must take place during business
hours.
 Searching or browsing an online catalog can be faster than browsing the aisles of a
physical store.
 One can avoid crowded malls resulting in long lines, and no parking. Consumers with
dial-up Internet connections rather than broadband have much longer load times for
content-rich web sites and have a considerably slower online shopping experience.
 Some consumers prefer interacting with people rather than computers because they
find computers hard to use.
 Not all online retailers have succeeded in making their sites easy to use or reliable. On
the other hand, a majority of stores have made it easy to find the style one is looking
for, as well as the price range that is acceptable making the shopping experience quick
and efficient.
 The internet has made shopping an almost effortless task.
 Sends receipt to customer
 Accommodates up to four types of shipping
 Allows owner to predefine sales tax based a specific state
 Tracks purchases even if user clicks the back button

3.2.1 Advantage of Proposed system


 To generate the quick reports
 To make accuracy and efficient calculations
 To provide proper information briefly
 To provide data security
 To provide huge maintenance of records
 Flexibility of transactions can be completed in time

 It provides high level of security using different protocols like https etc.

48
49
CHAPTER-IV
REVIEW OF LITERATURE

50
"The Impact of web based application Agricultural Extension Services on Farmers'
Knowledge and Adoption of Improved Practices" (Labarta et al., 2013): This study eval-
uated the impact of a mobile phone-based farmer information application on smallholder
farmers' knowledge and adoption of improved agricultural practices. The findings revealed
that farmers who had access to the application demonstrated a higher level of knowledge and
were more likely to adopt recommended practices. This increased knowledge and adoption
positively influenced their agricultural sales and income.

"Farmers' Use of Mobile Phones for Information Seeking: A Case Study in Rural In-
dia" (Kumar and Singh, 2018): This study examined the use of mobile phones by farmers
in rural India for accessing agricultural information. The findings indicated that farmers who
regularly used mobile phones to access relevant information experienced improved decision-
making abilities, enhanced productivity, and increased sales. The convenience and timeliness
of information received through mobile phones positively impacted farmers' sales perform-
ance.

"Information Communication Technologies for Agricultural Extension in Developing


Countries: Analysis and Lessons Learned from Uganda" (Nakasone et al., 2014): This
study explored the use of information communication technologies (ICTs) for agricultural ex-
tension services in Uganda. The research highlighted that farmers who had access to ICT-
based extension services, including farmer information applications, reported higher agricul-
tural sales compared to those who relied solely on traditional extension methods. The availab-
ility of real-time market information and personalized recommendations improved farmers'
ability to make informed decisions, leading to increased sales and profitability.

"The Role of web based in Agricultural Extension Services Delivery: The Case of e-Hakimi
Application in Nigeria" (Tijani et al., 2019): This study investigated the impact of a mobile
phone-based agricultural extension application called e-Hakimi on farmers' access to market
information and sales performance in Nigeria. The results indicated that farmers who used the
application experienced increased sales and improved market integration. The application
provided real-time market prices, facilitated communication with potential buyers, and en-
abled farmers to make informed sales decisions, thereby positively influencing their sales
outcomes.

51
"web based Applications for Agricultural Development: A Systematic Review of the
Literature" (Haque et al., 2018): This systematic review examined the literature on mobile
phone applications for agricultural development, including farmer information applications.
The findings indicated that these applications have the potential to significantly improve
farmers' access to information, market linkages, and sales. The ability to receive real-time
market prices, weather updates, and expert advice positively influenced farmers' decision-
making and sales outcomes.

"Impact of ICT-Based Farmer Advisory Services on Crop Productivity and Farmers'


Income: Evidence from Rural India" (Bhattacharya and Narayanan, 2020): This study
assessed the impact of ICT-based farmer advisory services, including mobile applications, on
crop productivity and farmers' income in rural India. The results revealed that farmers who
used these services experienced higher crop productivity and increased income compared to
those who relied on conventional methods. The availability of accurate information on crop
management practices, market prices, and weather conditions positively affected farmers'
sales and profitability.

"Impact Assessment of an Integrated ICT-Based Farmer Advisory System: Evidence


from Rural Kenya" (Mtimet et al., 2016): This study evaluated the impact of an integrated
ICT-based farmer advisory system that included a mobile application on smallholder farmers
in rural Kenya. The findings demonstrated that farmers who had access to the application ex-
perienced improved yields, increased sales, and higher profits. The application provided tai-
lored recommendations on crop management, pest control, and market information, empow-
ering farmers to optimize their farming practices and sales strategies.

"Assessing the Impact of ;web based Phone-Based Agricultural Extension Services on


Farmers' Livelihoods: Evidence from Uganda" (Labarta et al., 2016): This research as-
sessed the impact of mobile phone-based agricultural extension services, including farmer in-
formation applications, on farmers' livelihoods in Uganda. The findings revealed that farmers
who used these services witnessed improvements in their income, sales, and overall liveli-
hoods. The access to market information, weather updates, and agricultural advice contrib-
uted to better decision-making and increased sales for the farmers.

52
Zuraida Muhammad, Muhammad Azri Asyraf Mohd Hafez, Nor Adni MatLeh, Zakiah
Mohd Yusoff , Shabinar Abd Hamid [1] The term "Internet of Things" refers to the
connection of objects, equipment, vehicles, and other electronic devices to a network for the
purpose of data exchange (IoT). The Internet of Things (IoT) is increasingly being utilised to
connect objects and collect data. As a result, the Internet of Things' use in agriculture is
crucial. The idea behind the project is to create a smart agriculture system that is connected to
the internet of things. The technology is combined with an irrigation system to deal with
Malaysia's variable weather. This system's microcontroller is a Raspberry Pi 4 Model B. The
temperature and humidity in the surrounding region, as well as the moisture level of the soil,
are monitored using the DHT22 and soil moisture sensor. The data will be available on both a
smartphone and a computer. As a result, Internet of Things (IoT) and Raspberry Pi-based
Smart Agriculture Systems have a significant impact on how farmers work. It will have a
good impact on agricultural productivity as well. In Malaysia, employing IoT-based irrigation
systems saves roughly 24.44 percent per year when compared to traditional irrigation
systems. This would save money on labour expenditures while also preventing water waste in
daily needs.

Divya J., Divya M.,Janani V. [2] Agriculture is essential to India's economy and people's
survival. The purpose of this project is to create an embedded-based soil monitoring and
irrigation system that will reduce manual field monitoring and provide information via a
mobile app. The method is intended to help farmers increase their agricultural output. A pH
sensor, a temperature sensor, and a humidity sensor are among the tools used to examine the
soil. Based on the findings, farmers may plant the best crop for the land. The sensor data is
sent to the field manager through Wi-Fi, and the crop advice is created with the help of the
mobile app. When the soil temperature is high, an automatic watering system is used. The
crop image is gathered and forwarded to the field manager for pesticide advice.

H.G.C.R. Laksiri, H.A.C. Dharmagunawardhana, J.V. Wijayakulasooriya


[3] Development of an effective loT-based smart irrigation system is also a crucial demand
for farmers in the field of agriculture. This research develops a low-cost, weather-based smart
watering system. To begin, an effective drip irrigation system must be devised that can
automatically regulate water flow to plants based on soil moisture levels. Then, to make this
water-saving irrigation system even more efficient, an IoT-based communication feature is
added, allowing a remote user to monitor soil moisture conditions and manually adjust water
flow. The system also includes temperature, humidity, and rain drop sensors, which have been

53
updated to allow remote monitoring of these parameters through the internet. In real time,
these field weather variables are stored in a remote database. Finally, based on the present
weather conditions, a weather prediction algorithm is employed to manage water distribution.
Farmers would be able to irrigate their crops more efficiently with the proposed smart
irrigation system.

Anushree Math, Layak Ali, Pruthviraj U[4] India is a country where agriculture plays a
vital role. As a result, it's critical to water the plants wisely in order to maximise yield per unit
space and so achieve good output. Irrigation is the process of providing a certain amount of
water to plants at a specific time. The purpose of this project is to water the plants on the
National Institute of Technology Karnataka campus with a smart drip irrigation system. To do
this, the open source platform is used as the system's fundamental controller. Various sensors
have been employed to supply the current parameters of components that impact plant
healthiness on a continual basis. By controlling a solenoid valve, water is provided to the
plants at regular intervals depending on the information acquired from the RTC module. The
webpage may be used to monitor and manage the complete irrigation system. This website
contains a function that allows you to manually or automatically control plant watering. The
health of the plants is monitored using a Raspberry Pi camera that gives live streaming to the
webpage. The controller receives water flow data from the water flow sensor through a
wireless network. The controller analyses this data to see if there are any leaks in the pipe.
Forecasting the weather is also done to restrict the quantity of water given, making it more
predictable and efficient.

Dweepayan Mishra, Arzeena Khan, Rajeev Tiwari, Shuchi Upadhaye [5] Agriculture is
a substantial source of revenue for Indians and has a huge impact on the Indian economy.
Crop development is essential for enhanced yield and higher-quality delivery. As a result,
crop beds with ideal conditions and appropriate moisture can have a big influence on output.
Traditional irrigation systems, such as stream flows from one end to the other, are usually
used. As a result of this delivery, the moisture levels in the fields can alter. A designed
watering system can help to enhance the management of the water system. This research
proposes a terrain-specific programmable water system that will save human work while
simultaneously improving water efficiency and agricultural productivity. The setup is made
up of an Arduino kit, a moisture sensor, and a Wi-Fi module. Data is acquired by connecting
our experimental system to a cloud framework. After then, cloud services analyse the data
and take the necessary actions.

54
R. Nageswara Rao, B.Sridhar [6] Agrarian countries like India rely heavily on agriculture
for their development. Agriculture has always been a roadblock to the country's development.
Smart agriculture, which comprises modernising present agricultural systems, is the only
answer to this challenge. As a result, the suggested strategy attempts to use automation and
Internet of Things technologies to make agriculture smarter. Crop growth monitoring and
selection, irrigation decision assistance, and other uses are possible thanks to the Internet of
Things (IoT). To modernise and boost crop yield, a Raspberry Pi-based autonomous irrigation
IOT system has been proposed. This project's main purpose is to produce crops using the
least amount of water possible. Most farmers waste a lot of time in the fields in order to focus
on water available to plants at the appropriate time. Water management should be improved,
and the system circuit's complexity should be minimised. Based on the data collected from
the sensors, the suggested system determines the amount of water required. Two sensors
detect the humidity and temperature of the soil, as well as the humidity, temperature, and
length of sunshine each day, and send the data to the base station. Based on these
characteristics, the recommended systems must calculate the irrigation water quantity. The
key benefit of the system is the integration of Precision Agriculture (PA) and cloud
computing, which will reduce water fertiliser consumption while increasing crop yields and
assisting in the evaluation of field weather conditions.

Shweta B. Saraf, Dhanashri H. Gawali [7] The Internet of Things (IoT) is the internet-
based connectivity of a huge number of devices (IoT). A unique identity links each item,
allowing data to be sent without human involvement It makes it possible to develop strategies
for improved natural resource management. Smart gadgets with sensors, according to the IoT
concept, enable interaction with the physical and logical worlds. The proposed system in this
study is built on the Internet of Things and uses real-time input data. Over a wireless sensor
network, a smart farm irrigation system uses an Android phone to remotely monitor and
regulate drips. Between sensor nodes and base stations, Zigbee is utilised to communicate. A
web-based java graphical user interface is used to process and present the server's real-time
observed data. Field irrigation system wireless monitoring eliminates human interaction and
enables for remote monitoring and control using an Android phone.

Cloud computing is a potential choice due to the large volume of data created by the wireless
sensor network. This research presents and examines a cloud-based wireless communication
system for monitoring and controlling a collection of sensors and actuators in order to
determine the water needs of plants.

55
Shrihari M[8] The concept of automating agricultural production has been around since the
early 1990s, and one of the primary challenges that both scientists and farmers confront is
irrigation. Irrigation is a dynamic system that is heavily reliant on outside influences. This
article describes a method that uses a custom-built mathematical model to handle data from
wireless sensors on Google Cloud, resulting in a smart system. An IoT-enabled design that
can scale up to big farms. According to Holistic Agricultural Studies, around 35 have been
damaged by animals and people. This intelligent system uses Tensor flow and deep learning
neural networks to recognise animals depending on their threat level, as well as human
intruders who are not authorised on the farm, and to alert the farmer immediately. An android
application is included with the device, which allows for remote access and surveillance
through live video streaming.

G. Sushanth, and S. Sujatha [9] Smart agriculture is a novel concept since IoT sensors can
offer information about agricultural regions and then act on it based on user input. The
purpose of this study is to develop a smart agricultural system that utilises cutting-edge
technologies such as Arduino, Internet of Things, and wireless sensor networks. Through
automation, the research tries to take use of emerging technologies such as the Internet of
Things (IoT) and smart agriculture. The capacity to monitor environmental factors is a critical
component in increasing crop efficiency. The purpose of this study is to develop a system that
can monitor temperature, humidity, wetness, and even the movement of animals that might
damage crops in agricultural areas using sensors, and then send an SMS notification as well
as a notification on the app developed for the same to the farmer's smartphone via
Wi-Fi/3G/4G if there is a discrepancy. The system uses a duplex communication link based
on a cellular Internet interface, which allows data inspection and irrigation schedule to be
changed using an android app. Because of its energy independence and inexpensive cost, the
gadget has the potential to be useful in water-scarce, geographically isolated areas.

Vaishali S, Suraj S, Vignesh G, Dhivya S and Udhayakumar S [10] From the beginning
of time, agriculture has been the most important practise in human society. Traditional
irrigation methods, such overhead sprinklers and flood irrigation, are inefficient. They waste
a lot of water and may even make people sick by causing fungus growth in the soil due to too
much moisture. Due to the scarcity of water, an automated irrigation system is essential for
water conservation and, as a result, agricultural profitability. Irrigation consumes around 85%
of the world's total accessible water resources. This need is projected to increase in the
coming years as the population grows. To meet this need, we must employ creative methods

56
that lower the quantity of water utilised in irrigation. Sensors in the automated system
monitor the availability of water to the crops, and watering is done as needed through
controlled irrigation. Because of its practically limitless storage and processing capabilities,
as well as its fast flexibility, cloud computing is an intriguing solution to the massive amount
of data generated

Hamza BENYEZZA,Mounir BOUHEDDA,Khaoula DJELLOUT,Amina SAIDI


[11] Water management currently global problem to all of us to tackle them in near future we
need to plan it smartly. As we are living in modern world filled with lots of useful sensors
from which we can designed systems with water saving capabilities. The work in this paper is
focusing on increasing effective use of water using field assist to farmer. Basically it works
with soil moisture sensor which gives finding of moisture level in soil and reconnects with
Thing Speaks cloud via Wi-Fi module ESP8266 to observation of soil conditions. Proposed
system also set with an algorithm such that on soil moisture pattern data it can predict
decision on irrigation of crops. system also warns farmer about empty water source if it
occurs . benefits of using this system also includes weather prediction through website. The
device has the potential to be beneficial in water-scarce, geographically isolated places due to
its energy independence and low cost. The fact that the technology is simple to use for
farmers adds to its utility. It also saves water by preventing waste.

Shiny Rajendrakumar, Prof. V K Parvati, Prof. Rajashekarappa [12] Agricultural


Irrigation is very important for the production of crops. Many methods have developed to
save water in different ways. In traditional irrigation systems we require an operator or farmer
to put water on crops but he does not come to know which crop require how much amount of
water to get proper amount of yields. Irrigation means planting the crops by water. There are
so many traditional irrigation methods, but all these methods consume large amount of water.
Automated irrigation is the method which saves the water from up to 97% as compared to
traditional methods. By using these modern methods like ICT productivity can be improved
without unnecessary wastage of water. Here we are concentrating on loT ie.

57
CHAPTER-V

SYSTEMDESIGN AND DEVELOPMENT

58
5. SYSTEMDESIGN AND DEVELOPMENT

Design is the first step in the development phase for any techniques and principles for the
purpose of defining a device, a process or system in sufficient detail to permit its physical
realization.
Once the software requirements have been analysed and specified the software design
involves three technical activities - design, coding, implementation and testing that are
required to build and verify the software.
The design activities are of main importance in this phase, because in this activity, decisions
ultimately affecting the success of the software implementation and its ease of maintenance
are made. These decisions have the final bearing upon reliability and maintainability of the
system. Design is the only way to accurately translate the customer’s requirements into
finished software or a system.
Design is the place where quality is fostered in development. Software design is a process
through which requirements are translated into a representation of software. Software design
is conducted in two steps. Preliminary design is concerned with the transformation of
requirements into data.

59
5.1 DATAFLOW DIAGRAM
A data flow diagram is graphical tool used to describe and analyze movement of data
through a system. These are the central tool and the basis from which the other components
are developed. The transformation of data from input to output, through processed, may be
described logically and independently of physical components associated with the system.
These are known as the logical data flow diagrams.
The physical data flow diagrams show the actual implements and movement of data
between people, departments and workstations. A full description of a system actually
consists of a set of data flow diagrams. Using two familiar notations Yourdon, Gane and
Sarson notation develops the data flow diagrams. Each component in a DFD is labeled with a
descriptive name. Process is further identified with a number that will be used for
identification purpose.
The development of DFD’S is done in several levels. Each process in lower level
diagrams can be broken down into a more detailed DFD in the next level. The lop-level
diagram is often called context diagram. It consists a single process bit, which plays vital role
in studying the current system. The process in the context level diagram is exploded into
other process at the first level DFD.
The idea behind the explosion of a process into more process is that understanding at
one level of detail is exploded into greater detail at the next level. This is done until further
explosion is necessary and an adequate amount of detail is described for analyst to understand
the process.
Larry Constantine first developed the DFD as a way of expressing system
requirements in a graphical from, this lead to the modular design.
A DFD is also known as a “bubble Chart” has the purpose of clarifying system
requirements and identifying major transformations that will become programs in system
design. So it is the starting point of the design to the lowest level of detail. A DFD consists
of a series of bubbles joined by data flows in the system.

60
DFD SYMBOLS:
In the DFD, there are four symbols
1. A square defines a source(originator) or destination of system data
2. An arrow identifies data flow. It is the pipeline through which the information flows
3. A circle or a bubble represents a process that transforms incoming data flow into outgoing
data flows.
4. An open rectangle is a data store, data at rest or a temporary repository of data

Process that transforms data flow.

Source or Destination of data

Data flow

Data Store

CONSTRUCTING A DFD:
Several rules of thumb are used in drawing DFD’S:
1. Process should be named and numbered for an easy reference. Each name should be rep-
resentative of the process.
2. The direction of flow is from top to bottom and from left to right. Data traditionally flow
from source to the destination although they may flow back to the source. One way to in-
dicate this is to draw long flow line back to a source. An alternative way is to repeat the
source symbol as a destination. Since it is used more than once in the DFD it is marked
with a short diagonal.
3. When a process is exploded into lower level details, they are numbered.
4. The names of data stores and destinations are written in capital letters. Process and data-
flow names have the first letter of each work capitalized

61
5.2 INPUT DESIGN

Input design is a part of overall system design. The main objective during the input design as
given below:
 To produce cost-effective method of input

 To achieve the highest possible level of accuracy.

 To ensure that the input is acceptable and understood by the user.

Input States:
The main input stages can be listed as below:
 Data recording

 Data transcription

 Data conversion

 Data verification

 Data control

 Data transmission

 Data validation

 Data correction

Input Types:
It is necessary to determine the various types of input. Inputs can be categorized as follows:
 External Inputs which are prime inputs for the system.

 Internal Inputs, which are user communications with the systems.

 Operational, which are computer department’s communications to the system?

 Interactive, which are inputs entered during a dialogue.

Input Media:
At this stage choice has to be made about the input media. To conclude about the input media
consideration has to be given to:
 Type of Input

 Flexibility of Format

62
 Speed

 Accuracy

 Verification methods

 Rejection rates

 Ease of correction

 Storage and handling requirements

 Security

 Easy to use

 Portability

Keeping in view the above description of the input types and input media, it can be said that
most of the inputs are of the form of internal and interactive. As input data is to be directly
keyed in by the user, the keyboard can be considered to be the most suitable input device.
SAMPLE INPUT DESIGN:

63
64
5.3 OUTPUT DESIGN
Outputs from computer systems are required primarily to communicate the results of
processing to users. They are also used to provide a permanent copy of the results for later
consultation. The various types of outputs in general are:
 External Outputs, whose destination is outside the organization,.
 Internal Outputs whose destination is within organization and they are the
 User’s main interface with the computer.
 Operational outputs whose use is purely within the computer department.
 Interface outputs, which involve the user in communicating directly with User Inter-
face.
Output Definition: The outputs should be defined in terms of the following points:
 Type of the output
 Content of the output
 Format of the output
 Location of the output
 Frequency of the output
 Volume of the output
 Sequence of the output

It is not always desirable to print or display data as it is held on a computer. It should be


decided as which form of the output is the most suitable.
For Example
 Will decimal points need to be inserted
 Should leading zeros be suppressed.

Output Media:
In the next stage it is to be decided that which medium is the most appropriate for the output.
The main considerations when deciding about the output media are:
 The suitability for the device to the particular application.
 The need for a hard copy.
 The response time required.
 The location of the users

65
 The software and hardware available.
Keeping in view the above description the project is to have outputs mainly coming under the
category of internal outputs. The main outputs desired according to the requirement
specification are: The outputs were needed to be generated as a hot copy and as well as
queries to be viewed on the screen. Keeping in view these outputs, the format for the output
is taken from the outputs, which are currently being obtained after manual processing. The
standard printer is to be used as output media for hard copies
SAMPLE OUT PUTS:

66
67
68
5.4 DATABASE DESIGN

Database design can be generally defined as a collection of tasks or processes that enhance
the designing, development, implementation, and maintenance of enterprise data management
system. Designing a proper database reduces the maintenance cost thereby improving data
consistency and the cost-effective measures are greatly influenced in terms of disk storage
space. Therefore, there has to be a brilliant concept of designing a database. The designer
should follow the constraints and decide how the elements correlate and what kind of data
must be stored.

The main objectives behind database designing are to produce physical and logical design
models of the proposed database system. To elaborate this, the logical model is primarily
concentrated on the requirements of data and the considerations must be made in terms of
monolithic considerations and hence the stored physical data must be stored independent of
the physical conditions. On the other hand, the physical database design model includes a
translation of the logical design model of the database by keep control of physical media
using hardware resources and software systems such as Database Management System
(DBMS).

Database design is a critical aspect of building an efficient and effective application. It in-
volves designing the structure, organization, and relationships of the database to store and re-
trieve data accurately and efficiently. Here are some key considerations and steps involved in
the process of database design:

Requirements Analysis: Start by understanding the requirements of your application and the
data it needs to store. Identify the entities (objects) that will be represented in the database
and the relationships between them.

Conceptual Design: Create a conceptual model that represents the high-level view of the
database structure. This can be done using entity-relationship diagrams (ERDs), which depict
entities, attributes, and relationships between entities.

69
Normalize the Data: Normalize the data by applying normalization rules to ensure data integ -
rity and minimize redundancy. This involves breaking down data into smaller, logical units to
avoid data duplication and update anomalies.

Define Tables and Columns: Based on the conceptual model, define the tables and their
columns in the database. Identify primary keys, which uniquely identify each record, and
define appropriate data types for each column.

Establish Relationships: Define the relationships between tables using foreign keys. This en-
sures referential integrity and establishes the connections between related data.

Indexing: Identify the columns that will be frequently used for searching or sorting and con-
sider adding indexes on those columns. Indexing can significantly improve query perform-
ance.

Set Constraints: Implement constraints such as unique constraints, not-null constraints, and
foreign key constraints to maintain data integrity and enforce business rules.

Consider Performance and Scalability: Design the database with performance and scalability
in mind. Consider factors like anticipated data volumes, query patterns, and potential growth
to optimize performance and ensure the database can handle increasing demands.

Security: Implement appropriate security measures to protect the data. This may include de -
fining user roles and permissions, encrypting sensitive data, and implementing secure authen-
tication and access control mechanisms.

Testing and Refinement: Test the database design thoroughly to ensure it meets the require-
ments and performs as expected. Make any necessary refinements based on feedback and
testing results.

70
5.5 MODULE DESCRIPTION

 Login Module: –
 This will help farmer/vendor/public to login into the system using id and
password. A farmer/vendor/public who has the valid id and password can
only login to their respective accounts. It will help the authentication of
the farmer/vendor/public who enters the system.
 Admin Module
 Login: Admin login into the system using id and password.
 Add Farming Information: He can add the forming details that is use-
ful for farmers.
 Add Market: He can add the market details. Farmer can search the dif-
ferent market in various cities.
 Reports: In this module generate reports like market , farmer informa-
tion.
 Farmer Module
 login: The farmer can fill the registration form and get his credentials.
 Add Product: All the details of the product will be uploaded by the
farmer. He will fix the rates of the products. He will add the details of the
item. He can update the details of the item.
 Orders: He can view the order details.
 Search Market: He can search the different market in various cities.
 Payment: He manage the payment details also.
 Search Farming: Farmer can also gathering the useful farming informa-
tion.
 Vendor Module
 Register: Vendor will get the username and password by filling the regis-
tration form. He will view all the details of the product.

71
 Search Farmer: He can search the former details also.
 Order: He will see the list of products that he want to buy. He order the
bulk of products.
 Payment: He can view the sales rate details. The payment details man-
aged by farmer and COD mode.
 Public Module
 login: Public will get the username and password by filling the registra-
tion form.
 Search Farmer: He will view all the details of the product. He can
search the former details also.
 Order For Function: He will see the list of products that he want to
buy. He orders the bulk of products for only function.
 Payment: He can view the sales rate details. The payment details man-
aged by farmer and COD mode.

72
CHAPTER-VI
TESTING AND IMPLEMENTATION

73
6.1 TESTING

The purpose of testing is to discover errors. Testing is the process of trying to


discover every conceivable fault or weakness in a work product. It provides a way to
check the functionality of components, sub-assemblies, assemblies and/or a finished
product It is the process of exercising software with the intent of ensuring that the
Software system meets its requirements and user expectations and does not fail in an
unacceptable manner. There are various types of test. Each test type addresses a
specific testing requirement.

TYPES OF TESTS

Unit testing
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software
units of the application .it is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path of a
business process performs accurately to the documented specifications and contains clearly
defined inputs and expected results.
Integration testing
Integration tests are designed to test integrated software components to determine if
they actually run as one program. Testing is event driven and is more concerned with the
basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically aimed
at exposing the problems that arise from the combination of components.

74
Functional test
Functional tests provide systematic demonstrations that functions tested are available
as specified by the business and technical requirements, system documentation, and user
manuals.
Functional testing is centered on the following items:
Valid Input : identified classes of valid input must be accepted.
Invalid Input : identified classes of invalid input must be rejected.
Functions : identified functions must be exercised.
Output : identified classes of application outputs must be exercised.
Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key functions,


or special test cases. In addition, systematic coverage pertaining to identify Business process
flows; data fields, predefined processes, and successive processes must be considered for
testing. Before functional testing is complete, additional tests are identified and the effective
value of current tests is determined.

System Test
System testing ensures that the entire integrated software system meets requirements. It
tests a configuration to ensure known and predictable results. An example of system testing is
the configuration oriented system integration test. System testing is based on process
descriptions and flows, emphasizing pre-driven process links and integration points.

White Box Testing


White Box Testing is a testing in which in which the software tester has knowledge of
the inner workings, structure and language of the software, or at least its purpose. It is
purpose. It is used to test areas that cannot be reached from a black box level.

Black Box Testing


Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests,
must be written from a definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a testing in which the
software under test is treated, as a black box .you cannot “see” into it. The test provides

75
inputs and responds to outputs without considering how the software works.

Unit Testing:

Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as
two distinct phases.

Test strategy and approach


Field testing will be performed manually and functional tests will be written in
detail.

Test objectives
 All field entries must work properly.
 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.

Features to be tested
 Verify that the entries are of the correct format
 No duplicate entries should be allowed
 All links should take the user to the correct page

Integration Testing
Software integration testing is the incremental integration testing of two or
more integrated software components on a single platform to produce failures caused
by interface defects.
The task of the integration test is to check that components or software
applications, e.g. components in a software system or – one step up – software
applications at the company level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.

76
Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system meets the
functional requirements.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.

SYSTEM IMPLEMENTATION:

Systems implementation is the process of:


1. defining how the information system should be built (i.e., physical system design),
2. ensuring that the information system is operational and used,
3. ensuring that the information system meets quality standard (i.e., quality assurance).

Systems design
Conceptual design – what the system should do
Logical design – what the system should look to the user
Physical design – how the system should be built

Physical system design using structured design approach:


à To produce a system that is easy to read, code, and maintain
1. Factoring: decomposition
2. Span of control: 9 subordinate modules
3. Reasonable size: 50-100 LOC
4. Coupling: minimize inter-module dependency
5. Cohesion: single module functionality
6. Shared use: multiple calls to lower level modules from different bosses

Structured design tools


· Organization of programs and program modules (structure chart)
· Processing logic specification in each module (pseudocode)

Structure chart – to show graphically

77
1. how the various program parts/modules of an information system are physically or-
ganized hierarchically
2. how the modules communicate with each other through data couple (data exchange)
and flag (control/message)
3. how the modules are related to each other in terms of sequence, selection, and repeti-
tion

Implementation is the realization of a design so that it can be executed on a computer. This


includes the realization of: the system's classes; the user interface; and the database
structures.
Testing comprises all activities to accomplish a satisfactory level of confidence that the
system under development fulfills it intended purpose. Objects of testing can be documents
(such as specifications) or software (such as a module or a complete system). The goal of
testing is to find errors and remove the causes of the errors.

Testing and implementation are obviously closely connected. If a concept is to be executed


on a computer, as the definition of “implementation” states, then the implementation must run
without errors, otherwise the concept has not been implemented (or at least not correctly
implemented).

SYSTEM SECURITY
The protection of computer based resources that includes hardware, software, data,
procedures and people against unauthorized use or natural
Disaster is known as System Security.
System Security can be divided into four related issues:
 Security
 Integrity
 Privacy
 Confidentiality
SYSTEM SECURITY refers to the technical innovations and procedures applied to the
hardware and operation systems to protect against deliberate or accidental damage from a
defined threat.

78
DATA SECURITY is the protection of data from loss, disclosure, modification and
destruction.
SYSTEM INTEGRITY refers to the power functioning of hardware and programs,
appropriate physical security and safety against external threats such as eavesdropping and
wiretapping.
PRIVACY defines the rights of the user or organizations to determine what information they
are willing to share with or accept from others and how the organization can be protected
against unwelcome, unfair or excessive dissemination of information about it.
CONFIDENTIALITY is a special status given to sensitive information in a database to
minimize the possible invasion of privacy. It is an attribute of information that characterizes
its need for protection.
SECURITY SOFTWARE
System security refers to various validations on data in form of checks and controls to avoid
the system from failing. It is always important to ensure that only valid data is entered and
only valid operations are performed on the system. The system employees two types of
checks and controls:
CLIENT SIDE VALIDATION
Various client side validations are used to ensure on the client side that only valid data
is entered. Client side validation saves server time and load to handle invalid data. Some
checks imposed are:
 VBScript in used to ensure those required fields are filled with suitable data only. Maxi-
mum lengths of the fields of the forms are appropriately defined.
 Forms cannot be submitted without filling up the mandatory data so that manual mistakes
of submitting empty fields that are mandatory can be sorted out at the client side to save
the server time and load.
 Tab-indexes are set according to the need and taking into account the ease of user while
working with the system.
SERVER SIDE VALIDATION
Some checks cannot be applied at client side. Server side checks are necessary to save
the system from failing and intimating the user that some invalid operation has been per-
formed or the performed operation is restricted. Some of the server side checks imposed is:
 Server side constraint has been imposed to check for the validity of primary key and for-
eign key. A primary key value cannot be duplicated. Any attempt to duplicate the primary

79
value results into a message intimating the user about those values through the forms us-
ing foreign key can be updated only of the existing foreign key values.
 User is intimating through appropriate messages about the successful operations or excep-
tions occurring at server side.
 Various Access Control Mechanisms have been built so that one user may not agitate
upon another. Access permissions to various types of users are controlled according to the
organizational structure. Only permitted users can log on to the system and can have ac-
cess according to their category. User- name, passwords and permissions are controlled o
the server side.

IMPLEMENTATION:

a. Database Setup: Create the necessary database tables and establish the required relation-
ships to store and retrieve data accurately.

b. Backend Development: Implement the server-side logic of your application using Python.
This involves integrating data sources, implementing algorithms for analysis and recom-
mendation, and developing sales-related functionalities.

c. Frontend Development: Build the user interface using Python web frameworks like Django
or Flask. Design intuitive and user-friendly screens for farmers to access information, input
data, and perform sales-related tasks.

d. Data Integration: Integrate relevant data sources such as weather APIs, market data feeds,
and agricultural databases. Ensure data flows correctly between the application and external
sources.

e. Deployment: Prepare your application for deployment by configuring the server, setting up
the necessary dependencies, and ensuring the application is secure and optimized for produc-
tion.

f. User Training and Support: Provide necessary training to end-users (farmers) on how to use
the application effectively. Offer ongoing support and address any issues or questions that
may arise.

80
Modular Code Structure: Organize your code into reusable modules and follow a modular
design approach. This helps improve code maintainability, readability, and reusability.

Object-Oriented Programming (OOP): Utilize the principles of OOP to design your


application. Encapsulate related functionality within classes and leverage concepts like
inheritance, polymorphism, and abstraction to build a well-structured and extensible
codebase.

Error Handling: Implement proper error handling mechanisms throughout your application.
Use exception handling to gracefully handle errors and prevent application crashes or security
vulnerabilities.

Documentation: Document your codebase thoroughly. Provide clear comments,


function/method descriptions, and usage examples to help other developers understand and
work with your code.

Version Control: Use a version control system (e.g., Git) to track changes in your codebase,
collaborate with other developers, and facilitate easy rollback or recovery if issues arise.

SYSTEM SECURITY:

User Authentication and Authorization: Implement secure user authentication and


authorization mechanisms to control access to the application's features and data. Utilize
strong password policies, enforce user roles and permissions, and consider using techniques
like multi-factor authentication for enhanced security.

Secure Data Transmission: Encrypt data transmitted over the network using secure protocols
such as HTTPS/SSL/TLS. Protect sensitive data from interception and unauthorized access.

Input Validation: Validate and sanitize all user inputs to prevent common security
vulnerabilities like SQL injection, cross-site scripting (XSS), and cross-site request forgery
(CSRF). Use secure coding practices and frameworks that provide built-in protection against
these threats.

81
Secure Database Management: Follow secure database management practices, such as using
parameterized queries or prepared statements to prevent SQL injection attacks. Regularly
update and patch your database management system to address security vulnerabilities.

Session Management: Implement secure session management to ensure the integrity and
confidentiality of user sessions. Use techniques like session encryption, session expiration,
and secure cookie handling to protect against session hijacking or session fixation attacks.

Regular Security Audits and Updates: Conduct regular security audits to identify and address
vulnerabilities in your application. Stay updated with security best practices, frameworks, and
libraries to incorporate the latest security features and patches into your application.

Backup and Disaster Recovery: Implement regular data backups and disaster recovery plans
to ensure data integrity and availability in the event of system failures or security incidents.

82
CHAPTER-VII
CONCLUSION

83
7. CONCLUSION
In this project, the information related to cultivation of all types are provided.
helpline is user friendly for farmers. After enrolment of the farmer’s details, the queries are
given with solution by agriculture expertise. This application has many benefits through
this, farmer can decide the crop to sow based on various climatic changes, so that they can
able to get a good yield while cultivating the crops and also helps for getting information
based on government scheme for particular crops, weather report, seasonable crops to sow,
fertilizer etc.,
Such an application can empower farmers with access to real-time information, per-
sonalized recommendations, and sales-related functionalities. By leveraging Python's capa-
bilities and frameworks like Django or Flask, developers can create a user-friendly inter-
face, integrate data sources, implement data analysis algorithms, and enable sales-related
features.

The project encompasses several stages, including system testing and implementa-
tion. System testing involves conducting unit testing, integration testing, functional testing,
performance testing, and user acceptance testing to ensure the application functions as ex-
pected and meets user requirements. Implementation involves setting up the database, de-
veloping the backend and frontend components, integrating data sources, deploying the ap-
plication, and providing user training and support.

System security is of utmost importance in the project. Implementing proper secu-


rity measures, such as user authentication and authorization, secure data transmission, input
validation, secure database management, session management, and regular security audits,
helps protect the application and users' data from potential vulnerabilities and attacks.

By successfully implementing the farmer information application and ensuring ro-


bust system security, farmers can benefit from improved access to information, better deci-
sion-making capabilities, optimized agricultural practices, and enhanced sales outcomes.
The application can contribute to increasing productivity, profitability, and sustainability in
the agricultural sector, ultimately improving the livelihoods of farmers.

84
It's important to note that the success of the project relies on thorough planning,
careful design, efficient implementation, and continuous improvement. Regular updates, in-
corporating user feedback, and staying updated with technological advancements and best
practices are crucial for the long-term success of the farmer information application.

FUTURE ENHANCEMENT:
The farmer information application for agriculture and sales can be further enhanced in several
ways to provide more value and better meet the evolving needs of farmers. Here are some fu-
ture enhancement ideas for the project:

Mobile Application: Extend the application by developing a mobile version compatible with
iOS and Android platforms. This will allow farmers to access information and perform sales-
related tasks conveniently on their smartphones or tablets, even while they are in the field.

Geolocation Integration: Incorporate geolocation capabilities into the application to provide lo-
cation-specific information and recommendations. This can include localized weather fore-
casts, soil condition analysis, and nearby market information. Geolocation can help farmers
make more informed decisions tailored to their specific location.

Integration with IoT Devices: Explore integrating Internet of Things (IoT) devices, such as soil
moisture sensors, weather stations, or crop monitoring systems, into the application. This inte-
gration would enable farmers to receive real-time data from their fields, allowing them to mon-
itor conditions and make timely adjustments to optimize their farming practices and sales
strategies.

Advanced Analytics and Machine Learning: Utilize advanced analytics and machine learning
algorithms to provide more accurate predictions and personalized recommendations. For exam-
ple, machine learning models can analyze historical data to forecast crop yields, predict market
trends, or identify optimal pricing strategies.

Social Collaboration Features: Implement social collaboration features within the application
to facilitate knowledge sharing and community engagement among farmers. This could include
discussion forums, chat features, and the ability to share success stories, farming techniques,

85
and market insights. Peer-to-peer interaction can foster a sense of community and provide
valuable support to farmers.

Integration with E-Commerce Platforms: Enable direct integration with e-commerce platforms
or online marketplaces to streamline the sales process. Farmers can list their products, manage
inventory, and receive orders directly through the application, simplifying the sales and distri-
bution process.

Multilingual Support: Incorporate multilingual support to cater to farmers from diverse linguis-
tic backgrounds. This will ensure that the application is accessible and usable for farmers who
speak different languages, thus expanding its reach and impact.

Data Visualization: Enhance the application's data visualization capabilities by incorporating


interactive charts, graphs, and dashboards. Visual representations of data can help farmers un-
derstand trends, patterns, and insights more effectively.

Continuous Improvement and Feedback: Implement mechanisms to gather feedback from


farmers and incorporate their suggestions for improving the application. Regularly update the
application based on user feedback and emerging needs to ensure it remains relevant and valu-
able to farmers.

Integration with Agricultural Institutions: Collaborate with agricultural research institutions,


government agencies, and other stakeholders to access authoritative data, expert advice, and
market insights. This integration can provide farmers with reliable and up-to-date information,
further enhancing the application's effectiveness.

By implementing these future enhancements, the farmer information application can evolve
into a comprehensive and indispensable tool for farmers, facilitating informed decision-mak-
ing, improving productivity, and driving sales growth in the agricultural sector.

86
BIBLIOGRAPHY

87
REFERENCE BOOKS

[1] Boyer, J. M. (2008). Interactive Office Documents A New Face for Web 2.0 Applications,
Proceedings of the 2008 ACM Symposium on Document Engineering.

[2] Relaxing the homogeneity assumption in usability testing. Behaviour & Information
Technology, 20 1–7.

[3] Caulton, D. A. (2001Cavana, R., Delahaye, B., & Sekaran, U. (2001). Applied Business
Research Qualitative and Quantitative Methods, John Wiley & Sons, Milton, Queens land.

[4] An Online Evolutionary Approach to Developing Internet Services, HOTOS'03


Proceedings of the 9th conference on Topics in Operating Systems. M.C & Boyle R. D.,
(2003).

REFERENCE WEBSITES

 www.codeproject.com

 www.w3schools.com

 www.learnprogramming.com

88
APPENDIX

.
A)DATA FLOW DIAGRAM

Login
management

Public Farmer Farmer


management Information management
System

Vendor
management

Zero Level DFD

Login Check User Login


Management Details

Farmer Generate product


Management Farmer Report
Information
System
Vendor Generate order
Management Report

Public Generate vendor


Management Report

First Level DFD

89
90
Level 2

91
B) ENTITY RELATIONSHIP DIAGRM

They provide the data at logic level. They are characterized by that fact that they
provide flexible structuring capabilities and allow data constraints to be specified explicitly.
The entity relationship data model is based on a perception of a real world that consists of a
set of basic object entities and relationships among the objects. it was developed to facilities
database design. The ER data model is one of several semantic data modelling. The semantic
aspect of model lies in the attempt to represent the meaning of data. ER model is externally
used in meaning and interactive of real world enterprises.
E-R model has some means of describing the physical database model; it is useful in the
design and communication of the logical database model. In this model, objects of similar
structure are collected into an entity set. The relationship between entity sets is requested by a
named E-R relationship. The database structure employing the E-R model is usually shown
pictorially using entity - relationship (E - R) diagrams.

92
93
USE CASE DIAGRAM:

A use case diagram is a visual representation of the interactions between actors (users or
systems) and the system under consideration. It depicts the functional requirements and the
interactions between various entities involved in a system. Use case diagrams are part of the
Unified Modeling Language (UML), which is a standard notation used for modeling software
systems.

The main purpose of a use case diagram is to illustrate the functionalities provided by a
system from the perspective of users or external systems. It helps in identifying the actors
(users or external systems), defining the system's boundaries, and specifying the various use
cases or actions performed by the actors.

Key components of a use case diagram:

Actors: Actors represent individuals, organizations, or external systems that interact with the
system. Actors are represented by stick figures. They can be primary actors (directly involved
in the system) or secondary actors (indirectly involved in the system).

Use Cases: Use cases represent specific functionalities or actions performed by the actors.
Use cases are represented by ovals or ellipses. They describe the system's behavior from the
user's perspective.

Relationships: Relationships define the associations between actors and use cases. The main
relationship used in a use case diagram is the association relationship, represented by a solid
line connecting an actor to a use case. Other relationships include extends and includes
relationships, which represent optional and mandatory behavior extensions, respectively.

System Boundary: The system boundary represents the scope or boundary of the system
under consideration. It is typically represented by a rectangle that encloses the use cases and
actors.

94
Add Products

Search Market

Farmer
Payment Details

Manage products

Manage orders

Gathering Information

Vendor Login and Logout from system

Change Account Password

Registrations

View products

Public
Place orders

Search Farmers

Usecase Diagram

95
DATABAE DESIGN

This database used in this project is similar in structure to that of the relational database.
In the document database the data values are maintained as a file in which all the information
are stored in document.
But the relational database is like tables, which are represented, in physical database
as stored files. They have their own independent existence. A table consists of rows and
columns. Each column corresponds to a piece of information called fields. A set of fields
constitutes a record. The record contains all the information, specific to the particular item.
The database design involves creation of tables. Tables are represented in physical
database as stored files. They have their own independent existence. A table consists of rows
and columns. Each column corresponds to a piece of information called field. A set of fields
constitute a record. The record contains all the information, specific to a particular item.

Table name: Table login

Description: Farmer login details

Name Type Size Description

User id bigint 50 User identification

User name Varchar 20 User name

Password Varchar 50 Password

96
Table name : Table user

Primary Key : uid

Description: User Registration details

Name Type Size Description

uid Varchar 20 User Id

uname Varchar 20 User Name

pwd Varchar 20 Password

cpwd Varchar 20 Confirm Password

street Varchar 20 Street

place Varchar 20 Place

city Varchar 20 City

pin Numeric 10 Pin Code

dob Varchar 20 Date of Birth

mailid Varchar 30 E-Mail Id

occupation Varchar 30 Occuption

97
Table name : Table Order

Primary Key : ord id

Description: User order details

Name Type Size Description

ord id bigint 20 Sales Id

user id bigint 20 user id

proid Varchar 50 Product id

Delivery date Varchar 50 Delivery

Requdate Varchar 20 Require date

Status Varchar 20 Status of order confirm

98
Table name : Table Agriproduct Sales

Primary Key : Sales id

Description: User Sales details

Name Type Size Description

Sales id bigint 20 Sales Id

cus id bigint 20 customer id

Custname Varchar 50 Customer Name

Mobile no Varchar 50 Mobile number

Final Numeric 20 Final catalog

Total Varchar 20 Total amounts

99
Table name : Table Agri product

Primary Key : proid

Description: Product details

Name Type Size Description

proid Numeric 20 product Id

proname Varchar 50 Product Name

Description Varchar 50 Dealer name

Price Numeric 20 Amount

Image Url Varchar 50 product Date

100
Table name : Table Billing

Primary key : billid

Name Type Size Description

Billid Bigint 20 Billing id

Cusid Bigint 50 Customerid

Product id Bigint 20 Product details

Quantity Varchar 50 Quantity of product

Amount Varchar 100 Total amount

Pay mode Varchar 50 Payment type

101
SAMPLE SCREEN SHOTS

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
SAMPLE CODING:

from django.db import models

class Category(models.Model):
name = models.CharField(max_length=50)
description = models.CharField(max_length=1000,null=True)
def __str__(self):
return self.name
class Register_Detail(models.Model):
name = models.CharField(max_length=50,unique=True)
address = models.CharField(max_length=50)
mobile = models.CharField(max_length=20)
password = models.CharField(max_length=50)
email = models.EmailField(max_length=50)
user_type = models.CharField(max_length=30,null=True)
def __str__(self):
return self.name
class Product(models.Model):
p_name = models.CharField(max_length=50)
p_price = models.CharField(max_length=50)
category = models.ForeignKey(Category,
on_delete=models.CASCADE)
note = models.TextField(max_length=2000)
expire_date = models.DateField(null=True,blank=True)
image = models.FileField('Upload
Image',upload_to='documents/',null=True)
user_id = models.ForeignKey(Register_Detail,
on_delete=models.CASCADE,null=True)
def __str__(self):
return self.p_name
class Service(models.Model):
service = models.CharField(max_length=50)
date = models.CharField(max_length=50)
time = models.CharField(max_length=20)
member = models.CharField(max_length=50)
note = models.EmailField(max_length=50)
class Cart_Details(models.Model):
user_id = models.ForeignKey(Register_Detail,
on_delete=models.CASCADE,null=True)
book_id = models.CharField(null=True,max_length=30)
product_id = models.ForeignKey(Product,
on_delete=models.CASCADE,null=True)

118
farmer_id = models.IntegerField(null=True)
status = models.CharField(max_length=50)
tot = models.IntegerField(null=True)
tot_price = models.FloatField(null=True)
date = models.DateField(null=True)
class Market_Detail(models.Model):
name = models.CharField(max_length=100)
address = models.CharField(max_length=1000)
city = models.CharField(max_length=100)
area = models.CharField(max_length=100)
state = models.CharField(max_length=100)
image = models.FileField('Upload
Image',upload_to='documents/',null=True)
def __str__(self):
return self.name
class Veg_Detail(models.Model):
market_id = models.ForeignKey(Market_Detail,
on_delete=models.CASCADE)
veg_name = models.CharField(max_length=1000)
quantity = models.CharField(max_length=100)
price = models.CharField(max_length=100)
date = models.DateField(null=True)
image = models.FileField('Upload
Image',upload_to='documents/',null=True)
def __str__(self):
return self.veg_name
class Forming_Detail(models.Model):
name = models.CharField('Vegetable Name',max_length=100)
water_contain = models.TextField('Water Level',max_length=3000)
fertilizer = models.TextField('Fertilizer',max_length=3000)
soil = models.TextField('Nature of Soli',max_length=3000)
others = models.TextField(max_length=3000)
image = models.FileField('Upload Image',upload_to='farmer/')
def __str__(self):
return self.name

119
from django.contrib import admin

from . models import *

admin.site.register(Market_Detail)

admin.site.register(Veg_Detail)

admin.site.register(Category)

admin.site.register(Product)

admin.site.register(Register_Detail)

admin.site.register(Cart_Details)

admin.site.register(Forming_Detail)

from django.shortcuts import render,redirect

from django.contrib import messages

from . models import *

from django.db.models import Sum

import random

from django.conf import settings

from django.utils import timezone

from django.db import connection

from django.db.models import Q

def category(request):

if request.method == 'POST':

a=request.POST.get('name')

b = request.POST.get('con')

post=Category.objects.create(name=a,description=b)

messages.success(request,'Category Added Successfully')

return render(request,'category.html',{})

def farmer_login(request):

120
if request.method == 'POST':

name=request.POST.get('username')

pwd=request.POST.get('password')

user_exist=Register_Detail.objects.filter(name=name,password=pwd,user_type='farmer')

if user_exist:

request.session['name']= request.POST.get('username')

a = request.session['name']

sess = Register_Detail.objects.only('id').get(name=a).id

request.session['user_id']= sess

return redirect('form')

else:

messages.success(request,'Invalid username or Password')

return render(request,'admin_login.html',{})

def form(request):

a=Category.objects.all()

return render(request,'catform.html',{'b':a})

def product_list(request):

a=Product.objects.all()

return render(request,'product_list.html',{'b':a})

def catedit(request,pk):

a=Category.objects.filter(id=pk)

if request.method == 'POST':

c=request.POST.get('name')

b = request.POST.get('con')

update=Category.objects.filter(id=pk).update(name=c,description=b)

if update:

121
messages.success(request,'Category Updated Successfully')

return render(request,'cat_edit.html',{'value':a})

def catdelete(request,pk):

a=Category.objects.filter(id=pk).delete()

return redirect('form')

def login_details(request):

if request.method == 'POST':

name=request.POST.get('username')

pwd=request.POST.get('password')

user_exist=Register_Detail.objects.filter(name=name,password=pwd,user_type='pub-
lic')

if user_exist:

request.session['name']= request.POST.get('username')

a = request.session['name']

sess = Register_Detail.objects.only('id').get(name=a).id

request.session['user_id']= sess

return redirect('view_farmer')

else:

messages.success(request,'Invalid username or Password')

return render(request,'temlogin.html',{})

def profile(request):

return render(request,'dashboard.html',{})

def tem(request):

return render(request,'home.html',{})

def reg(request):

if request.method == 'POST':

122
Name = request.POST.get('uname')

Adddress = request.POST.get('address')

Mobile= request.POST.get('mobile')

Email = request.POST.get('email')

Password = request.POST.get('pwd')

utype = request.POST.get('user_type')

crt = Register_Detail.objects.create(name=Name,

address=Adddress,mobile=Mobile,password=Password,email=Email,user_type=utype)

if crt:

messages.success(request,'Registered Successfully')

return render(request,'register.html',{})

def con(request):

if request.method == 'POST':

a = request.POST.get('name')

b =request.POST.get('mail')

c = request.POST.get('subject')

d = request.POST.get('msg')

crt = Contact_Detail.objects.create(name=a,email=b,subject=c,msg=d)

if crt:

messages.success(request,'Thanks for Contact Us.')

return render(request,'contact.html',{})

def dash(request):

return render(request,'dashboard.html',{})

def userdash(request):

return render(request,'user_dashboard.html',{})

123
def product(request):

a=Category.objects.all()

user_id = request.session['user_id']

uid = Register_Detail.objects.get(id=int(user_id))

if request.method == 'POST':

a=request.POST.get('name')

b=request.POST.get('price')

c=request.POST.get('category')

d=request.POST.get('con')

f =request.FILES['pic']

c_id=Category.objects.get(id=int(c))

prt =
Product.objects.create(p_name=a,p_price=b,category=c_id,note=d,cmp_price='',image=f,user
_id=uid)

if prt:

messages.success(request,'Product Added Successfully')

return redirect('product')

return render(request,'product.html',{'a':a})

def logout(request):

try:

del request.session['user_id']

except:

pass

return render(request, 'temlogin.html', {})

def order(request):

order = Booking_Detail.objects.all()

return render(request,'order.html',{'order':order})

def view_product(request):

124
user_id = request.session['user_id']

a=Product.objects.filter(user_id=int(user_id))

return render(request,'view_product.html',{'b':a})

def view_farmer(request):

a=Register_Detail.objects.filter(user_type='farmer')

return render(request,'farmer_info.html',{'b':a})

def product_edit(request,pk):

a=Product.objects.filter(id=pk)

b = Category.objects.all()

if request.method == 'POST':

a=request.POST.get('name')

b=request.POST.get('price')

c=request.POST.get('category')

d=request.POST.get('con')

e = request.POST.get('others')

c_id=Category.objects.get(id=int(c))

prt =
Product.objects.filter(id=pk).update(p_name=a,p_price=b,category=c_id,note=d,cmp_price=
e)

if prt:

return redirect('view_product')

messages.success(request,'Product Updated Successfully')

return render(request,'product_edit.html',{'value':a,'b':b})

def product_delete(request,pk):

a=Product.objects.filter(id=pk).delete()

return redirect('view_product')

def veg_product(request):

user_id = request.GET.get('fid')

125
product = Product.objects.filter(user_id=int(user_id))

uid = request.session['user_id']

return render(request,'veg_product.html',{'product':product})

def add_to_cart(request,pk):

if request.session.has_key('user_id'):

uid = request.session['user_id']

farmer_id = request.GET.get('fid')

user_id = Register_Detail.objects.get(id=int(uid))

product_id = Product.objects.get(id=int(pk))

product_detail = Product.objects.filter(id=int(pk))

if request.method == 'POST':

price = request.GET.get('price')

tot = request.POST.get('tot')

tot_price = float(price)*int(tot)

crt =
Cart_Details.objects.create(user_id=user_id,product_id=product_id,status='pending',

tot=tot,tot_price=tot_price,farmer_id=int(farmer_id))

if crt:

return redirect('view_items_cart_product')

return render(request,'add_to_cart.html',{'product_detail':product_detail})

else:

return render(request,'temlogin.html',{})

def remove_item(request,pk):

Cart_Details.objects.filter(id=int(pk)).delete()

return redirect('view_items_cart_product')

def cart(request):

126
uid = request.session['user_id']

product_details = Cart_Details.objects.filter(user_id=int(uid),status='pending')

return render(request,'cart.html',{'product_details':product_details})

def view_items_cart(request,pk):

product_details = Cart_Details.objects.filter(book_id=int(pk))

tot = Cart_Details.objects.filter(book_id=int(pk)).aggregate(Sum('tot'))

return render(request,'view_items_cart.html',
{'product_details':product_details,'pk':pk,'tot':tot})

def payment_received(request,pk):

Cart_Details.objects.filter(book_id=int(pk)).update(status='paid')

return redirect('order')

def purchased(request):

uid = request.session['user_id']

product_details = Cart_Details.objects.filter(user_id=int(uid),status='paid')

return render(request,'purchased.html',{'product_details':product_details})

def order_purchased(request):

product_details = Cart_Details.objects.filter(user_id=int(uid),status='paid')

return render(request,'purchased.html',{'product_details':product_details})

def ordered_item(request):

uid = request.session['user_id']

order = Booking_Detail.objects.filter(user_id=int(uid))

return render(request,'ordered_item.html',{'order':order})

def view_items_cart_product(request):

uid = request.session['user_id']

r_num = random.randrange(20, 50, 3)

product_details = Cart_Details.objects.filter(status='pending',user_id=int(uid))

tot =
Cart_Details.objects.filter(status='pending',user_id=int(uid)).aggregate(Sum('tot_price'))

127
return render(request,'view_items_cart_product.html',{'product_details':product_de-
tails,'tot':tot,'r_num':r_num})

def purchase(request):

uid = request.session['user_id']

order_id = request.GET.get('order_id')

addr = Register_Detail.objects.filter(id=int(uid))

if request.method == 'POST':

upd =
Cart_Details.objects.filter(user_id=int(uid),status='pending').update(status='order',book_id=o
rder_id,date=timezone.now())

if upd:

return redirect('order_item_user')

return render(request,'purchase.html',{'addr':addr})

def purchased_item(request,pk,status):

uid = request.session['user_id']

product_details = Cart_Details.objects.filter(book_id=pk,user_id=int(uid))

tot =
Cart_Details.objects.filter(book_id=pk,user_id=int(uid)).aggregate(Sum('tot_price'))

return render(request,'purchased_item.html',
{'product_details':product_details,'tot':tot,'status':status})

def order_item_user(request):

uid = request.session['user_id']

cursor = connection.cursor()

post = '''SELECT Sum(app_cart_details.tot_price), app_cart_details.book_id,


app_cart_details.date, app_cart_details.status,

app_cart_details.user_id_id from app_cart_details where app_cart_details.status='or-


der' OR app_cart_details.status='paid' AND

app_cart_details.user_id_id = '%d' Group By app_cart_details.book_id ''' %


(int(uid))

query = cursor.execute(post)

128
row = cursor.fetchall()

return render(request,'order_item_user.html',{'product_details':row})

def order_item(request):

farmer_id = request.session['user_id']

cursor = connection.cursor()

post = '''SELECT Sum(app_cart_details.tot_price), app_cart_details.book_id,


app_cart_details.date, app_cart_details.status,

app_cart_details.user_id_id from app_cart_details where app_cart_details.status='or-


der' OR app_cart_details.status='paid'

AND app_cart_details.farmer_id='%d' Group By app_cart_details.book_id ''' %


(int(farmer_id))

query = cursor.execute(post)

row = cursor.fetchall()

return render(request,'order_item.html',{'product_details':row})

def status_order(request,pk,user_id,status):

addr = Register_Detail.objects.filter(id=int(user_id))

product_details = Cart_Details.objects.filter(book_id=pk)

tot = Cart_Details.objects.filter(book_id=pk).aggregate(Sum('tot_price'))

if request.method == 'POST':

upd = Cart_Details.objects.filter(book_id=pk).update(status='paid')

if upd:

return redirect('order_item')

return render(request,'status_order.html',
{'tot':tot,'product_details':product_details,'addr':addr,'pk':pk,'user_id':user_id,'status':status})

def search_market(request):

if request.method == 'POST':

a = request.POST.get('search')

ids = Market_Detail.objects.filter(Q(city__istartswith=a)|
Q(area__istartswith=a))

129
return render(request,'search_product.html',{'ids':ids})

else:

return render(request,'search_product.html',{})

def veg_details(request,pk):

ids = Veg_Detail.objects.filter(market_id=int(pk))

return render(request,'veg_details.html',{'ids':ids})

def search(request):

if request.method == 'POST':

a = request.POST.get('search')

ids = Forming_Detail.objects.filter(name__istartswith=a)

return render(request,'search.html',{'ids':ids})

else:

return render(request,'search.html',{})

130
THANK YOU

131

1
FARMER INFORMATION APP FOR AGRICULTURE AND SALES
2
TABLE OF CONTENTS
CHAPTERS
TITLE
PAGE
NO
ABSTRACT
1
INTRODUCTION
  1.1 OVERVIEW OF THE PROJECT
6
1.2 COMPANY PROFILE
10
2
S
3
ABSTRACT
Farmer Information System is a web application developed for farmers. This application gives
suppose to the villag
4
Market Information: The application aggregates market data from various sources, including
local markets and online platfor
5
CHAPTER-I
INTRODUCTION
6
1. INTRODUCTION
1.1 OVERVIEW OF THE PROJECT
 farmer Information System is a web application developed for Traders. This app
7
Administrator:
           Admin maintain all the information about Agriculture officers details. It deals with the
creation
8
MODULE SPECIFICATION
The modules of the project are: –
Login Module
Admin
Farmer
Vendor
Public
Login Module: –
This  will
9
Register: Vendor will get the username and password by filling the registration form. He will view
all the details of the p
10
1.2 COMPANY PROFILE 
SRI MILLENNIUM COMPUTER TECHNOLGIESS (SMC Technologiess) is a software and em-
bedded development com

You might also like