0% found this document useful (0 votes)
16 views49 pages

Final Document

Uploaded by

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

Final Document

Uploaded by

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

SYNOPSIS

The Student CGPA (Cumulative Grade Point Average) Calculator is a web application
developed with the Django framework, designed to assist students in managing their academic
records efficiently. This application enables users to register, log in, and securely manage their
subjects, grades, and credits.

By leveraging Django’s robust authentication system, the platform ensures that each
user’s data remains private and accessible only to them.

The application features a comprehensive Subject Management system that allows


users to perform CRUD (Create, Read, Update, Delete) operations on their subjects, ensuring
accurate record-keeping.

As users input grades and corresponding credits, the CGPA is calculated dynamically
using a predefined formula, providing instant feedback on academic performance.

Form validation is integrated to ensure that only valid data is submitted, with error
messages guiding users in correcting any mistakes. The user interface is designed for
responsiveness, utilizing Bootstrap to provide a seamless experience across devices, from
desktops to mobile phones.

Additionally, the application includes a feature for generating printable reports,


allowing users to export their academic records in a neatly formatted manner.

This functionality is beneficial for students seeking to maintain a hard copy of their
performance for personal reference or submission to external parties.

Overall, the CGPA Calculator is a user-friendly tool that enhances the academic
experience, enabling students to track and manage their performance effectively.

1
INTRODUCTION

This project is a Django web-based Student Cumulative Grade Point Average (CGPA)
calculator designed specifically for students, enabling them to efficiently manage their subjects,
grades, and credit hours. Built with Django 5.1, the application is structured around models,
views, and templates, ensuring a robust and scalable platform. At its core is the Subject model,
which encapsulates essential details like subject name, grade, and credit hours, and employs a
foreign key to link each subject to a specific user.
User authentication is a critical aspect, providing a secure environment for data
management, with functionalities for registration and login that protect user information and
ensure that students can access and modify their records independently.

Once logged in, users can perform various CRUD operations on their subjects. The
application offers an intuitive interface for adding new subjects, allowing users to input
relevant details, which are crucial for accurate CGPA calculation. Users can easily create new
entries, view their existing subjects, edit grades or credit hours as needed, and delete subjects
they no longer wish to track.

The application’s primary feature is its ability to calculate CGPA based on the entered
grades and credit hours, utilizing a predefined mapping of letter grades to numeric values. This
function allows students to monitor their academic performance effectively over time.

The project leverages Django’s templating engine to create a clean, user-friendly


interface, enhanced by CSS for improved aesthetics. Each page is logically structured,
facilitating easy navigation from the login and registration screens to the main dashboard for
subject management and CGPA results.

Additionally, the CGPA calculator includes the capability to generate performance


reports, enabling students to print their calculations for personal reference or official
submissions, underscoring the application's practicality.

Overall, this project provides a comprehensive solution for students to manage their
academic records effectively while maintaining security and data integrity.

2
OBJECTIVE OF THE PROJECT

This Django project aims to create a comprehensive platform for students to efficiently
manage their academic records, with a primary focus on subject tracking and Cumulative Grade
Point Average (CGPA) calculation. The application is designed to facilitate the addition,
editing, and deletion of subjects, along with their corresponding grades and credit hours.

This functionality enables students to monitor their academic performance effectively


and stay organized throughout their studies. By allowing students to create accounts and log
in, the application guarantees that each user can manage their information privately,
safeguarding personal academic records from unauthorized access.

The automatic CGPA calculation feature is a standout aspect of the application. By


using a predefined mapping of letter grades to numeric values, the system computes the CGPA
based on the grades and credit hours that users input.

This real-time calculation provides valuable insights into students' academic progress,
enabling them to understand their performance better and make informed decisions about their
studies. As students add new subjects or modify existing entries, the application immediately
updates the CGPA, ensuring users always have access to their current academic standing.

The layout is structured logically, allowing users to seamlessly transition between


different functionalities such as adding subjects, viewing their lists, and checking their CGPA
results. Additionally, the system offers real-time feedback for user actions, ensuring that
students are informed about the success of their operations—whether it be adding a subject,
editing details, or deleting entries. This responsiveness is critical for keeping users engaged
and confident in their interactions with the platform.

Moreover, the application incorporates best practices in web development, particularl y


concerning security and data integrity. Utilizing Django's built-in authentication framework,
the project minimizes risks associated with unauthorized access and potential data breaches.

3
1.SYSTEM SPECIFICATION

1.1 HARDWARE SPECIFICATION

Platform : Windows 11

System : Dual core processor

RAM :8 GB

Hard disk : 512 GB

Processor : Intel Core i5 (9th gen)

1.2 SOFTWARE SPECIFICATION

Front end : HTML5, CSS3

Back end : Django Framework(Python 3.9)

User Interface :Bootstrap

Design : Bootstrap

Web Browser : Google Chrome, Firefox

Software : visual Studio Code

1.3 SOFTWARE FEATURE

FRONT END : HTML5

HTML stands for HyperText Markup Language.HTML is used to create web pages and
web applications.HTML is widely used language on the web.We can create a static website by
HTML only.Technically, HTML is a Markup language rather than a programming
language.HTML stands for HyperText Markup Language and is used to create content and
structure of any web page. It is the building block of web pages.

4
KEY COMPONENTS OF HTML

1. Tags: HTML tags are the building blocks of HTML documents. Tags like <h1>
(header), <p> (paragraph), and <a> (anchor for links) are used to format and organize
content. Most tags come in pairs with an opening tag (<p>) and a closing tag (</p>).
2. Attributes: HTML tags can have attributes that provide additional information about
the element. For example, the <img> tag, used to insert images, uses the src attribute to
define the image source: <imgsrc="image.jpg" alt="description">.
3. Elements: An element consists of an opening tag, content, and a closing tag. For
example, <p>This is a paragraph.</p> is a paragraph element. Some elements, like
<img>, are self-closing and don’t have content or a closing tag.
4. Document Structure: A basic HTML document starts with <!DOCTYPE html>,
followed by the <html> element, which contains the entire document. The document is
divided into two main sections:

 <head>: Contains metadata, links to stylesheets, scripts, and information not


directly displayed on the page.
 <body>: Contains the visible content, such as text, images, and multimedia.

CSS3

CSS, or Cascading Style Sheets, is the language used to style and enhance HTML
documents. It defines the presentation of HTML elements on a web page, enabling changes
to fonts, colors, sizes, spacing, column layouts, and animations.It controls how HTML
elements—such as text, images, and buttons—are displayed on a webpage. With CSS, you
can adjust font sizes and colors, add backgrounds, and manage the layout, transforming a
basic webpage into a visually appealing and user-friendly experience. CSS also
simplifies layout management across multiple web pages by using external stylesheets stored
in CSS files.Different Ways to Use CSS .CSS has three ways to style the HTML:

 Inline: Add styles directly to HTML elements using the style attribute (limited
use).
 Internal: Place styles within a <style> tag inside the HTML file, usually within
the <head> section
 External: Create a separate CSS file with a .css extension and link it to your
HTML file using the <link> tag.

5
CSS FEATURES
As you conquer the basics, explore these powerful features to elevate your web design:
 Media Queries: Tailor website layouts for different screen sizes, ensuring optimal
viewing experiences across devices.
 CSS Grid and Flexbox: Revolutionize website layouts with these frameworks for
creating complex and responsive designs.
 CSS Animations and Transitions: Add interactivity and visual flair to your
webpages with smooth animations and transitions.

BACK END - DJANGO FRAMEWORK

Django is a high-level, open-source web framework written in Python that enables rapid
development of secure and scalable web applications. It follows the Model-View-Template
(MVT) architectural pattern, which helps separate the business logic, user interface, and data
management. Django comes with built-in features like an admin panel, authentication system,
ORM (Object-Relational Mapping) for database interactions, and form handling, which allows
developers to build web applications faster while following best practices.

Django is designed to handle complex applications and has a strong emphasis on


reusability, making it easier to manage large projects. It also provides security features like
protection against SQL injection, cross-site scripting (XSS), and cross-site request forgery
(CSRF). Additionally, it supports scalability and can integrate with various databases and third-
party applications, making it ideal for both small and large-scale projects.

FEATURES OF DJANGO
 Versatile which allows us to develop any kind of web page.
 It is scalable
 It is extremely fast.
 Secure thereby helping developers.
 It comes along with content administrations, authentications.

6
PYTHON

Python is a popular programming language.Python can be used on a server to create


web applications.Python can be used along side software to create workflows.Python can
connect to database systems. It can also read and modify files.Python can be used to handle big
data and perform complex mathematics.Python can be used for rapid prototyping, or for
production-ready software development.Python works on different platforms (Windows, Mac,
Linux, Raspberry Pi, etc).Python has a simple syntax similar to the English language.Python
has syntax that allows developers to write programs with fewer lines than some other
programming languages.Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can be very quick.Python can be
treated in a procedural way, an object-oriented way or a functional way.Python was designed
for readability, and has some similarities to the English language with influence from
mathematics.Python uses new lines to complete a command, as opposed to other programming
languages which often use semicolons or parentheses.Python relies on indentation, using
whitespace, to define scope; such as the scope of loops, functions and classes. Other
programming languages often use curly-brackets for this purpose.It is used for:web
development (server-side),software development,mathematics,system scripting.

FEATURES OF PYTHON:

 Dynamically Typed - The data types of variables are determined during run-time.
We do not need to specify the data type of a variable during writing codes.
 High-level - High-level language means human readable code.Compiled and
Interpreted - Python code first gets compiled into bytecode, and then interpreted
line by line.
 Garbage Collected - Memory allocation and de-allocation are automatically
managed. Programmers do not specifically need to manage the memory.
 Purely Object-Oriented - It refers to everything as an object, including numbers and
strings.
 Rich Standard Library - Python comes with several standard libraries that provide
ready-to-use modules and functions for various tasks, ranging from web
development and data manipulation to machine learning and networking.

7
2.SYSTEM STUDY

2.1 EXISTING SYSTEM

The existing CGPA calculator system provides basic functionalities such as adding,
editing, and deleting subjects, calculating CGPA, and user authentication. However, it lacks
customization options, advanced features, and a user-friendly interface.

Users need to be logged in to access the calculator's functionalities.The SubjectForm


ensures that user-submitted data for subjects is valid. The code includes basic error handling
for scenarios like user login failures and registration issues. The Subject model allows for user-
specific data storage, while views like cgpa_calculator and user authentication processes enable
personalized experiences.

2.2 DRAWBACKS OF EXISTING SYSTEM

 Limited Customization: It doesn't allow users to customize the grade point scale or
implement a weighted credit system. This limits its applicability to different educational
systems and grading standards.
 Limited User Interface: The interface might not be user-friendly or responsive to
different devices, making it difficult to use on various platforms.
 Data Management Issues: There might be limitations in exporting or importing data,
making it difficult to transfer data between devices or share it with others.
 No Offline Functionality: The system might require an internet connection to function,
limiting its usability in certain scenarios.
 Limited Integration: It might not integrate with other educational tools or platforms,
such as learning management systems (LMS).

8
2.3 PROPOSED SYSTEM

Ensure the calculator is accessible and usable on various devices (desktop, tablet,
mobile) by implementing responsive design principles.Adapt the layout and elements to fit
different screen sizes. Use clear and concise language in the interface.Allow users to export
their data (subjects, grades, CGPA) to a CSV or PDF file. Provide an option to import data
from a file for easy data entry or transfer between devices.
Use intuitive icons and symbols for actions.Consider implementing offline
functionality, allowing users to use the calculator without an internet connection.Store data
locally and sync it with the server when an internet connection is available.

Grade Point Scale Customization:

 Allow users to customize the grade point scale used for calculations. This would
accommodate different educational systems or grading standards.
 Provide pre-defined options for common grading systems (e.g., GPA 4.0, CGPA 10)
and a custom option for users to enter their own scale.

2.4 ADVANTAGES OF PROPOSED SYSTEM

 Real-Time CGPA Calculation: Users can instantly see their CGPA update as they
enter or modify their grades and credits, providing immediate feedback on their
academic performance.
 Data Visualization: The integration of charts and graphs helps users visualize their
grades and credits effectively, making it easier to understand their academic
standing and trends over time.
 Secure User Authentication: The system employs secure user authentication,
ensuring that personal data is protected and only accessible to the authorized user.
 Grade Management: Users can manage their subjects and grades systematically,
allowing for better organization and tracking of academic progress.

9
3.SYSTEM DESIGN

3.1 OVERVIEW OF THE PROJECT

This project is a Student CGPA (Cumulative Grade Point Average) calculator built using
the Django framework. The primary goal of the project is to allow students to manage their
subjects, input their grades, and calculate their overall CGPA based on the entered grades and
corresponding credits.

The User Authentication have Registration, Login, and Logout: The platform allows
users to create their accounts, log in, and log out securely. This ensures that each user has a
personalized experience where their subjects and CGPA calculations are private and tied to
their account. Security: Django's built-in authentication system handles user sessions and
passwords securely by using hashed passwords, making sure sensitive information is protected.
User-Specific Data: Only logged-in users can manage their subjects and perform calculations,
ensuring that the data is tied to individual users and cannot be accessed by others.

The Subject Management have CRUD Operations (Create, Read, Update, Delete):
Users can perform all the basic actions needed to manage their academic records. Add
Subjects: Users can add new subjects, providing the subject name, the grade they received, and
the credits assigned to the subject.Edit Subjects: If users want to correct any information or
change the grade/credits for a subject, they can easily update it. Delete Subjects: In case a
subject is no longer relevant, or added by mistake, users can remove it. Grade and Credit Data:
The application uses this data to perform the CGPA calculations dynamically, so accuracy is
important. The Dynamic CGPA Calculation have Automatic Calculation: As soon as the user
inputs grades and credits for all their subjects, the app dynamically calculates the CGPA based
on the formula:

10
The system applies a predefined grade-point mapping (e.g., A = 10, B = 8, etc.),
multiplying each grade's corresponding grade points with the subject's credit value. This sum
is divided by the total number of credits to calculate the CGPA.

The Form Validation have Django Form Handling: The application uses Django’s form
system, which ensures that all inputs are validated before being processed. For example:

Grade Validation: Ensures that only valid grades (e.g., A, B, C) are entered.Credit
Validation: Ensures credits are numerical and within a valid range (e.g., between 1 and 5
credits).Empty Fields: Users can’t submit forms with missing information, preventing errors
during CGPA calculation. Error Handling: If the user inputs invalid data, Django provides
helpful error messages that guide the user in correcting their input. The Responsive Design
have Mobile and Desktop Compatibility: The user interface is built with responsiveness in
mind, using Bootstrap or other CSS frameworks to ensure that the layout adapts to different
screen sizes. User Experience (UX): The design is optimized so that users on mobile devices
or tablets can easily interact with the application without any need for zooming in or scrolling
unnecessarily. The forms, buttons, and text fields are designed to be accessible and easy to use
on both smaller and larger screens.

The Printable Report have Generating Reports: The system allows users to export a
summary of their subjects, grades, credits, and CGPA. This can be done using either a
downloadable PDF or a printable HTML page.Format: The report is neatly formatted to display
all the essential information such as:A list of all subjects.The corresponding grades and credits.

The overall calculated CGPA Usage: This feature is useful for students who want a hard
copy of their performance report, either for their own reference or to submit to others .

MODULES

 Admin Panel
 User Authentication
 Subject Management
 CGPA Calculation
 Form Validation
 Responsive Design
 Printable Report

11
3.2 MODULES OF THE PROJECT

Admin Panel

Admin Panel provides administrators with an intuitive interface to manage users,


subjects, and overall system settings efficiently.

 User Management: Admin can view, edit, or delete user accounts.


 Subject Management: Admin can manage subject records for all users if necessary.

User Authentication

It ensures secure access, allowing users to create accounts, log in, and manage their
personal data while safeguarding sensitive information.

 Register: Allows new users to create an account.


 Login: Authenticates existing users.
 Logout: Logs the user out of the system.

Subject Management

This feature enables users to add, edit, and delete subjects along with their respective
grades and credits, fostering better organization of academic information. Enable users to add,
edit, delete, and view subjects with relevant details.

 Subject Model: Stores subject information like name, grade, and credits.
 Add Subject View: Allows users to add new subjects.
 Edit Subject View: Lets users modify existing subject details.
 Delete Subject View: Enables users to remove subjects from their list.
 List Subject View: Displays all subjects the user has entered.

CGPA Calculation

This functionality automatically computes the cumulative grade point average


based on the entered subjects and grades, simplifying this complex process for users.

12
 Grade Point System: Maps grades to corresponding grade points (e.g., A = 10, B =
8).
 Calculation Function: A backend function that calculates the CGPA using the
formulaCGPA=∑(GradePoints×Credits)/∑Credits
 Real-Time Calculation: Automatically updates the displayed CGPA whenever
subjects or grades are added/modified.

Form Validation

Form Validation is implemented to ensure all input is accurate and complete before
submission. Ensure the data entered by users is valid and follows the correct format.

 Subject Form: A Django form used to enter subjects, grades, and credits, with
validation rules for each field.
 Subject Name: Must not be blank.
 Grade: Must be a valid grade (e.g., A, B, C).
 Credits: Must be a positive number.

Responsive Design

The system is designed with a Responsive Design, ensuring it is accessible and


functional across various devices and screen sizes, enhancing usability for all users .Ensure the
web app adapts to different screen sizes and devices.

 CSS Framework (e.g., Bootstrap): Provides responsive grid layout, forms, and
buttons for optimal mobile and desktop experience.
 Media Queries: Used to adjust styles like font sizes, padding, and layouts based on
the screen size.

Printable Report

The Printable Report feature allows users to generate and print a comprehensive report
of their academic performance, providing a tangible summary of their achievements for
personal records or submission to educational institutions.Generate and display a printable
report of the user’s subjects and calculated CGPA.

13
 Report View: Generates a list of subjects, grades, credits, and the final CGPA in a
print-friendly format.
 Print Stylesheet: Special CSS to ensure the report is formatted correctly for
printing.
 Export Options: Provides options for exporting as PDF or printing directly from
the browser.
 Uses Django templates, HTML, and CSS for layout, and may use libraries like
xhtml2pdf for generating PDFs.

3.3 INPUT DESIGN

Input design in the proposed system is crucial for ensuring a smooth and user-friendly
experience when interacting with the application. It focuses on how users enter data and how
that data is validated and processed.

User Authentication: The login and registration forms feature clearly labeled fields for
usernames and passwords. Input validation checks for existing usernames during registration
and enforces password strength for security.

Subject Management: Users can add or edit subjects through a form that includes fields for
subject name, grade, and credit hours. Each field is equipped with input constraints, such as
character limits for the subject name and dropdown options for grades, minimizing the risk of
errors.

CGPA Calculation: Users input their grades and credits for each subject in structured tables.
This setup allows for easy addition or removal of subjects. Automatic updates to the CGPA
calculation occur as users modify their inputs, providing immediate feedback.

Form Validation: Each input form includes real-time validation to ensure that required fields
are filled out correctly before submission. For example, if a user tries to submit a subject
without entering a grade or credit, a clear error message prompts them to correct the input.

Responsive Design: Input fields are designed to be accessible on various devices, ensuring
users can input data easily on smartphones, tablets, or desktops.

14
3.4 OUTPUT DESIGN

Output design in the proposed system is centered around presenting the results of user
interactions in a clear, informative, and visually appealing manner. This design aspect focuses
on how data is displayed after users input their information, particularly in relation to CGPA
calculations and subject management.

CGPA Results: After users enter their subjects and grades, the system calculates the CGPA
and presents it prominently on the results page. This display includes a clear breakdown of the
total credits, grade points, and the final CGPA, ensuring users can easily understand their
academic performance.

Subject Overview: The output design features structured tables that list all subjects entered by
the user, including columns for subject name, grade, credit hours, and actions (edit/delete).
This organized format allows users to quickly review their data and make necessary
adjustments.

Printable Reports: The output design allows users to generate a printable report of their
academic performance. This report consolidates all entered data, CGPA calculations, and
visualizations into a well-structured format that can be easily printed or saved as a PDF for
sharing or personal records.

Responsive Display: All output elements are designed to be responsive, ensuring that
information is presented clearly across different devices. Whether on a desktop, tablet, or
smartphone, users will have a consistent experience viewing their results.

15
3.5 SYSTEM FLOW DIAGRAM

User
Login
Register
Access
pages

Views
Login/Register

Login page
Register page
CGPA Calculator page
Results page

AuthSystem
Add/Edit/Delete
subjects
Authenticate user
SubjectManager Show CGPA
Logout user
Calculation
Add Subject
Edit Subject
Delete Subject
Calculate CGPA

Figure 1 : Diagram of CGPA Calculator

16
3.6 USECASE DIAGRAM

3.7 DATAFLOW DIAGRAM

Dataflow Diagram- LEVEL 0

Login Register
Admin CGPA User
Calculator

17
Dataflow Diagram : LEVEL 1

User

User Authentication
Subject Management

Register Add subject


Login
Edit subject Delete subject

CGPA Calculator

Calculate CGPA

Result Generation

Display Results Print Results

18
Dataflow Diagram -LEVEL 2

user

User Authentication
Subject Management

Login Register

Edit subject Delete


Add subject
subject

Verify existing Confirm


credentails Validate data deletion
Create
input
user
account

Save Update remove


subject subject subject
Redirect
to login

CGPA Calculator

Fetch subject data Calculate CGPA

Result Generation

Print result Display


Results
result
5.IMPLEMENTATION AND TESTING

19
4.IMPLEMENTATION AND TESTING

4.1 CODING METHODS

To enhance your Django CGPA calculator project, consider implementing several


coding methods that focus on security, maintainability, and user experience.

First, utilize environment variables for sensitive configuration settings, such as your
secret key and database credentials, using packages like python-decouple.

This practice helps protect sensitive information and allows for easier configuration
changes across environments. Next, improve user authentication by integrating Django’s
built-in authentication views, which provide password reset functionality.

Additionally, use template inheritance in your HTML files to reduce redundancy. By


creating a base template, you can maintain a consistent look and feel across your application
while simplifying future updates.

Incorporate server-side validation in your forms by overriding the clean method,


ensuring that user input adheres to expected formats and values. For instance, you can
enforce positive credit values in your subject form, preventing invalid entries.

Enhance user interaction with JavaScript, particularly for features like receipt
generation. Implementing a function to print receipts directly can streamline the user
experience.

20
File structure of the project:

21
4.2 TESTING APPROACH

1. Unit Testing:

Unit testing is a software testing methodology focused on verifying the smallest testable
parts of an application, known as units.

 Models: The Subject model and its fields (name, grade, credit, user) should be tested
independently. Unit tests can be written to validate that the model saves correctly,
respects field constraints, and handles edge cases (e.g., a missing user, invalid grade,
or credit).
 Forms: The SubjectForm should be unit tested to ensure form validation works
correctly (e.g., valid input for grades and credits).
 Views: Each view function can be tested individually. For example:

 Test that the cgpa_calculator view returns the correct context variables
(subjects, form, cgpa).
 Test that the edit_subject, delete_subject, and result views handle HTTP
methods (GET/POST) appropriately.

1. Integration Testing:

Integration testing is a software testing phase where individual components or


systems are combined and tested as a group.

 Test the interaction between models, views, and templates. For instance, when
a subject is added via the form, ensure that it is saved in the database and
reflected on the page when the user revisits the CGPA calculator.
 Integration tests also validate that the login and registration processes interact
smoothly with the Django authentication system.

22
2. Functional Testing:

Functional testing ensures that the application properly satisfies the requirements
or specifications.

 This involves testing the end-to-end functionality of the application, simulating


user actions like logging in, adding/editing subjects, calculating CGPA, and
logging out.
 Test the flow from the login page, register a user, and ensure the user can access
the calculator and manage subjects.

TEST CASE

Test Case 1: Create Subject with Valid Data .

Description: Create a new subject with valid inputs.

Input user: valid User object, name: "Mathematics", grade: "A", credit: 3

Expected Outcome: Subject created .

4.3 SYSTEM IMPLEMENTATION

Here the project is set up by installing Django, creating a project, and an app to handle
the CGPA logic. Models are then defined to represent students and their subjects, each with
attributes like credit hours and grade points. These models form the basis of the database. Next,
views are implemented to handle CGPA calculations, where the total grade points are divided
by the total credit hours to compute the CGPA, which is then displayed to the user.

The app’s URLs are mapped to link the views to specific web pages, and a simple
template is created to show the CGPA results in the browser. After this, migrations are run to
set up the database tables, and the models are registered in Django’s admin panel for easy data
management. The project is tested locally using Django’s development server, and once

23
functioning correctly, it is prepared for deployment by configuring a production server (like
Gunicorn) and collecting static files. Finally, after deploying the app, regular maintenance tasks
like updating dependencies and backing up the database are ensured for smooth system
performance.

 User logs in, adds subject details using the form (name, grade, and credit).
 CGPA is calculated by summing the weighted grades and dividing by the total
credits.
 Results are displayed in a table with the final CGPA.

4.4 SYSTEM MAINTAINANCE

System maintenance for the CGPA Calculator application built with Django involves
several key tasks to ensure the app runs smoothly, securely, and efficiently. First, it is essential
to keep the Django framework and third-party libraries updated with the latest versions to patch
any security vulnerabilities. Regularly checking the database for integrity, cleaning up unused
records, and optimizing queries can help improve performance, especially as the number of
subjects and users grows.

Periodically reviewing and updating the code to ensure that features like user
authentication, form handling, and grade calculations work correctly is important for
maintaining functionality. Additionally, implementing logging and monitoring for errors and
user activities helps detect issues early and ensure the app is running as expected. Backing up
the database and ensuring proper storage and handling of user credentials is crucial for data
security. Finally, testing after updates or changes to the code ensures that the application
remains functional and reliable for users. Regular maintenance not only ensures a smooth user
experience but also enhances security and performance for the long term.

24
5. PROJECT EVALUATION

5.1 LIMITATION OF THE PROJECT

The current Django CGPA calculator code exhibits several limitations that could affect
its usability, security, and overall performance. Firstly, security is a significant concern,
particularly with the exposure of sensitive information such as the SECRET_KEY. This key
should remain confidential in a production environment to prevent unauthorized access.
Additionally, the application runs with DEBUG set to True, which is appropriate for
development but poses a risk in production, as it can reveal detailed error messages that may
expose vulnerabilities.

User authentication is another area that requires improvement. The system currently lacks
robust password policies, allowing for weak passwords that could compromise user accounts.
Furthermore, the feedback provided during the login process is minimal, with users receiving
vague messages regarding authentication failures. This could lead to confusion, particularly for
new users. Implementing more descriptive error messages and enforcing stronger password
requirements would enhance security and user experience.

Data integrity is another limitation, especially regarding the handling of subject entries. The
application does not prevent users from entering duplicate subjects, which could result in
conflicting data and make it challenging to accurately calculate CGPA. Implementing checks
to identify duplicates before saving entries would improve the integrity of the data being
processed.

The user interface, while functional, could benefit from significant improvements. For
example, form validation messages are not prominently displayed, which may lead users to
submit forms without realizing there are errors. Enhancing the clarity and visibility of these
messages would make the application more user-friendly. Moreover, the navigation between
different pages and functionalities could be streamlined to create a more intuitive user
experience.

25
In terms of performance, the application currently retrieves all subject entries from the database
without pagination. As the number of subjects grows, this could lead to slower response times
and a less efficient user experience. Implementing pagination or lazy loading techniques would

help manage larger datasets more effectively, ensuring that users can interact with the
application without delays.

The architecture of the application also poses challenges for maintainability. The business logic
is tightly coupled with the view functions, which makes the codebase harder to manage and
test. Separating concerns by moving business logic to service layers or utility functions could
lead to a cleaner and more modular design. This would not only facilitate easier updates and
testing but also make the codebase more understandable for new developers.

Furthermore, the application lacks comprehensive documentation and comments. This absence
makes it difficult for other developers to understand the code or contribute to its improvement.
Proper documentation outlining the architecture, functionalities, and usage of the application
would enhance collaboration and reduce onboarding time for new developers.

Lastly, the current implementation does not support advanced features such as downloadable
reports or data import/export functionalities. These features could significantly enhance user
engagement and utility, particularly for students looking to maintain records of their academic
performance. Including options for generating reports in various formats would broaden the
application’s usability.

26
5.2 FURTHER SCOPE OF PROJECT

These include integrating a more robust database system for production,


implementing user roles for better access control, and adding unit tests to ensure functionality
remains intact during development. Additionally, implementing RESTful API endpoints could
allow for mobile app integration, expanding the application's usability beyond web interfaces.
Overall, this Django project serves as an excellent starting point for a CGPA calculator and
subject management system, demonstrating best practices in Django development, modularity,
and user interface design. With continued development and refinement, it could evolve into a
comprehensive educational tool for students.Here we consider the following areas for further
scope:

User Profile Management:

 Implement a user profile model that stores additional user information (e.g., full name,
email, program of study). Allow users to update their profiles.

Enhanced CGPA Calculation:

 Allow users to specify weightings for different subjects or semesters.

Visual Representation:

 Use libraries like Chart or Plot to visualize the CGPA trend over semesters or years.
Generate reports in various formats (PDF, Excel) for user download.

Data Export:

 Allow users to export their grades and CGPA calculations to CSV or JSON formats for
use in other applications.

Feedback System:

 Implement a feedback mechanism for users to report issues or suggest features.

27
6.CONCLUSION AND SCREENSHOTS

6.1 CONCLUSION

This application serves as a practical tool for students to keep track of their academic
performance and calculate their CGPA. It incorporates fundamental Django features such as
models, forms, views, and templates, demonstrating a well-structured web application with
user authentication and data management capabilities.

The Django application is a CGPA calculator that allows users to manage their subjects,
calculate their GPA based on grades and credits, and handle user authentication (registration,
login, and logout). It utilizes models, forms, and views to provide a functional interface for
students to track their academic performance.

The application is structured with best practices in mind, making it a practical tool for academic
management. Future enhancements could focus on security improvements and additional
features for a more comprehensive user experience. this Django-based CGPA calculator is a
functional, user-friendly tool that empowers students to manage their academic records
efficiently. By combining user authentication, subject management, and CGPA calculation, the
application addresses a critical need in student life.

28
6.2 BIBLIOGRAPHY

Book References

 “Python Crash Course” by Eric Matthes- A hands-on introduction to programming in


Python, covering basic concepts and practical applications.
 Learning Python" by Mark Lutz-A comprehensive guide that covers the fundamentals
of Python programming, suitable for both beginners and experienced programmers.
 "Django for Beginners" by William S. Vincent-A hands-on guide to building web
applications with Django, perfect for those new to the framework.

Website

https://www.tutorialspoint.com/html/index.htm

https://www.geeksforgeeks.org/css-tutorial/

https://www.javatpoint.com/python-tutorial

29
6.3 SOURCE CODE

<!doctype html>

<html lang="en">

<head>

<!-- Required meta tags -->

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFsp
d3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-


awesome/6.4.0/css/all.min.css">

<title>CGPA Calculator</title>

</head>

<body>

<br>

<br>

<br>

<div class="container mt-4 bg-white col-md-3 card shadow p-3 " id="log">

<div class="login-form">

{% if messages %}

{% for message in messages %}

<div class="alert alert-success {{ message.tags }} mt-4" role="alert">

30
{{ message }}

</div>

{% endfor %}

{% endif %}

<form action="" method="post">

{% csrf_token %}

<h4 class="text-center" style="font-family: 'Times New Roman', Times,


serif;"> Login </h4>

<div class="form-group">

<input type="text" class="form-control" name="username"


placeholder="Username" required

style="background-color: #fff; border: 1px solid #ddd; border-radius: 5px;


padding: 10px;">

</div>

<div class="form-group mt-2">

<input type="password" class="form-control" name="password"


placeholder="Password" required

style="background-color: #fff; border: 1px solid #ddd; border-radius: 5px;


padding: 10px;">

</div>

<div class="form-group mt-2">

<button class="btn btn-light btn-block" style="margin-left: 138px;border: 0.5px


solid black">Login</button>

</div>

<br>

</form>

31
<p class="text-center" style="color: #555;"><a href="{% url 'register' %}" style="color:
#007bff;">Create an Account.</a></p>

</div>

</div>

</body>

</html>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>CGPA Calculator</title>

</head>

<style>

body {

font-family: Arial, sans-serif;

margin: 20px;

#calculator {

max-width: 600px;

margin: 0 auto;

padding: 20px;

border: 1px solid #ccc;

border-radius: 5px;

32
h1{

color: #333;

text-align: center;

font-family: 'Times New Roman', Times, serif;

form {

margin-bottom: 20px;

button {

padding: 10px;

color: black;

border: none;

font-size: 13px;

font-weight: bold;

border-radius: 3px;

cursor: pointer;

table {

width: 100%;

border-collapse: collapse;

margin-top: 20px;

th, td {

border: 1px solid #ddd;

33
padding: 10px;

text-align: left;

th {

background-color: #d9dad9d7;

color: rgb(97, 93, 93);

#cgpa {

font-weight: bold;

a{

color: black;

</style>

<body>

<div id="calculator">

<h1 style="color: green;">GeeksforGeeks</h1>

<h2 style="font-family: 'Times New Roman', Times, serif; text-align:center;">CGPA


Calculator</h2>

<br>

<form method="post" action="{% url 'cgpa_calculator' %}">

{% csrf_token %}

{{form.as_p}}

<button type="submit">Add Subject</button>

<button> <a href="{% url 'result' %}">Generate Result</a></button>

34
</form>

<br>

<table>

<thead>

<tr>

<th>Subject</th>

<th>Grade</th>

<th>Credit</th>

<th>Actions</th>

</tr>

</thead>

<tbody>

{% for subject in subjects %}

<tr>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.name }}</td>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.grade }}</td>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.credit }}</td>

<td>

<button><a href="{% url 'edit_subject' subject.id %}">Edit</a></button>

<button><a href="{% url 'delete_subject' subject.id %}">Delete</a></button>

</td>

</tr>

{% endfor %}

</tbody>

35
</table>

</div>

<br>

<button style="margin-left: 400px;"> <a class="ok" href="{% url 'logout' %}">Logout


</a></button>

</body>

</html>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Document</title>

</head>

<body>

<style>

body {

font-family: Arial, sans-serif;

margin: 20px;

#calculator {

max-width: 400px;

margin: 0 auto;

padding: 20px;

36
border: 1px solid #ccc;

border-radius: 5px;

h2 {

font-family: 'Times New Roman', Times, serif;

button {

padding: 10px;

color: black;

border: none;

font-size: 13px;

font-weight: bold;

border-radius: 3px;

cursor: pointer;

a{

color: black;

</style>

<div id="calculator">

<br>

<h2 style="text-align: center;">Edit Subject</h2>

<br>

37
<form method="post" action="{% url 'edit_subject' subject_id=subject_id %}">

{% csrf_token %}

{{ form.as_p }}

<button type="submit">Save Changes</button>

</form>

<br>

<button><a href="{% url 'cgpa_calculator' %}">Cancel</a></button>

</div>

</body>

</html>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>CGPA Calculator</title>

<!-- Add jsPDF library -->

<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>

</head>

<style>

body {

font-family: Arial, sans-serif;

margin: 20px;

38
.calculator {

max-width: 600px;

margin: 0 auto;

padding: 20px;

border: 1px solid #ccc;

border-radius: 5px;

form {

margin-bottom: 20px;

table {

width: 100%;

border-collapse: collapse;

margin-top: 20px;

th,

td {

border: 1px solid #ddd;

padding: 10px;

text-align: left;

th {

color: rgb(97, 93, 93);

39
#cgpa {

font-weight: bold;

button {

padding: 10px;

color: black;

border: none;

font-size: 13px;

font-weight: bold;

border-radius: 3px;

cursor: pointer;

margin-left:655px

</style>

<body>

<div id="mn" class="calculator" >

<img style="width: 130px; height:130px; margin-left:230px"


src="https://i.ibb.co/JkyXTWp/1696184885877pp.jpg" alt="">

<br>

<br>

<table>

<thead>

<tr>

<th>Subject</th>

<th>Grade</th>

40
<th>Credit</th>

</tr>

</thead>

<tbody>

{% for subject in subjects %}

<tr>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.name


}}</td>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.grade


}}</td>

<td style="font-family: 'Times New Roman', Times, serif;">{{ subject.credit


}}</td>

</tr>

{% endfor %}

</tbody>

</table>

<h3 style="font-family: 'Times New Roman', Times, serif;">CGPA: <span


id="cgpa">{{cgpa}}</span></h3>

</div>

<br>

<button onclick="myfun('mn')" type="button" class="btn btn-success btn1 ">Generate


Receipt</button>

<script type="text/javascript">

function myfun(pa) {

let d = document.getElementById(pa).innerHTML;

document.body.innerHTML = d;

41
window.print();

</script>

</body>

</html>

<!doctype html>

<html lang="en">

<head>

<!-- Required meta tags -->

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFsp
d3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-


awesome/6.4.0/css/all.min.css">

<title>CGPA Calculator</title>

</head>

<body>

<body>

<br><br><br><br>

<div class="container mt-4 bg-white mx-auto col-md-3 card shadow p-3">

<div class="login-form">

{% if messages %}

{% for message in messages %}

42
<div class="alert alert-success {{ message.tags }}" role="alert" >

{{ message }}

</div>

{% endfor %}

{% endif %}

<form action="" method="post">

{% csrf_token %}

<h4 class="text-center" style="font-family: 'Times New Roman', Times, serif;">


Register </h4>

<div class="form-group">

<input type="text" class="form-control" name="username"


placeholder="Username" required>

</div>

<div class="form-group mt-2">

<input type="password" class="form-control" name="password"


placeholder="Password" required>

</div>

<div class="form-group mt-2">

<button class="btn btn-light btn-block" style="margin-left: 117px;border: 0.5px


solid black">Register</button>

</div>

<br>

</form>

<p class="text-center" ><a href="{% url 'login' %}">Log In </a></p>

</div>

43
</div>

</body>

</html>

44
6.4 SCREENSHOTS AND REPORTS

Figure 1 : Admin Page

Figure 2 : Admin Dashboard

45
Figure 3 : Admin Logout page

Figure 4 : User Register page

46
Figure 5 : User Login page

Figure 6 : CGPA calculator page

47
Figure 7 : Edit page

Figure 8 : Result page

48
Figure 9 : Print page

Figure 10 :Downloaded PDF

49

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy