0% found this document useful (0 votes)
66 views17 pages

4nm20cs139 Web-Report

The document describes a social media website project built using the Django web framework. The project allows users to register, create and modify profiles, post photos, like/comment on posts, and follow other users. It uses Django for the backend, SQLite3 for the database, and HTML/CSS/Bootstrap for the frontend. The project aims to demonstrate how to build a basic yet functional social media site using popular web development tools.

Uploaded by

acbd
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)
66 views17 pages

4nm20cs139 Web-Report

The document describes a social media website project built using the Django web framework. The project allows users to register, create and modify profiles, post photos, like/comment on posts, and follow other users. It uses Django for the backend, SQLite3 for the database, and HTML/CSS/Bootstrap for the frontend. The project aims to demonstrate how to build a basic yet functional social media site using popular web development tools.

Uploaded by

acbd
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/ 17

Social Media Website

Department of Computer Science and Engineering

Report on Mini Project

Social Media Website


Course Code : 20CSE41
Course Name : Web Programming

Semester:V SEM Section: C

Submitted To:

Dr Sarika Hegde
Associate Professor
Department of Computer Science
and Engineering

Submitted By:

Prathiksha Kini Shanelle D’Mello


4NM20CS139 4NM20CS161

Date of submission: 17-12-2022

Signature of Course Instructor


i
Social Media Website

ABSTRACT

Social networks constitute the greatest global information platform on the internet
today. They have become an indispensable part of our daily lives, As people
spend more time socializing on the internet.
The web project developed by Prathiksha Kini and Shanelle D’Mello simulates a
social media website called “Truffle” where the users can create, edit and update
their profiles with a strong authentication system provided inbuilt by the Django
framework. The logged in users can add, edit , download and delete posts,
search users, like and comment on the post as well as follow/unfollow other
users. The website hosts a user suggestion section where random users are
displayed on refreshing the page.

This project report will introduce how to build a social media web application
system using the Django framework. Django is an open-source web application
framework written in python. This social media web application system built using
Django has five major components with different functionalities that will be
introduced later. We will introduce various features of the Django framework and
SQLite3 RDBMS in the later section. In the end, snapshots are attached to
demonstrate UI.

ii
Social Media Website

TABLE OF CONTENTS

TitlePage .............................................................................................................................. 1

Abstract................................................................................................................................ 2

TableofContents .................................................................................................................. 3

Introduction ......................................................................................................................... 4

ProblemStatement............................................................................................................... 4

Objectives ............................................................................................................................ 5

Hardware/Software Requirement ....................................................................................... 6

Methodology ........................................................................................................................ 7

ImplementationDetails ...................................................................................................... 10

Results ............................................................................................................................... 13

Conclusion andFutureScope ........................................................................................... 16

References ......................................................................................................................... 17

iii
Social Media Website

INTRODUCTION

The project aims to create a desirable social media application for users with a
suitable UX design and proper backend management.

• The project uses the Django web framework (python framework) to implement
the social media application.

• The project uses SQLite3 software library for a relational database


management system in the backend to store, retrieve, and perform necessary
backend operations.

• HTML, Bootstrap, CSS, SCSS and Django Template Language implement the
front-end to customize the user interface.

PROBLEM STATEMENT

Truffle is a Django based social media website where users can utilize the
features exactly as on other straightforward social media websites. The goal of
the project was to demonstrate how the most popular web development
languages might be utilized to create a straightforward social media website.

Features:
As mentioned above, this application system has five vital components/features:
User registration/authentication, User posts, Search users, Like and Comment
on user posts and Follow/Unfollow users.

Dept. of CSE, NMAMIT Page 4


Social Media Website

• User registration/Authentication: Any application will include this primary


feature to register users in their application. To access all the other features, the
user must register into the application. We collect users fundamental data such
as email, username, first name, last name, password, and store it in the
database. Moreover the users can change their password for security purposes.

• Profile modification: This is an extended feature of user registration. Here,


users can create and modify their profiles. Users can change their profile picture,
email address, and their usernames. The altered data reflects in the database
system and the front-end of the application.

• User posts: Once the user has registered and set up a profile, they can post
photos and modify them accordingly. Users can like and comment and download
the posts.

• Follow/Unfollow users: The logged in user can follow/unfollow users from the
user suggestion section.

• Search users: Users can search other users by entering the username in the
search bar provided in the home page. A list of all users matching the username
typed will appear as a search result.

Objective:
Presenting a straightforward yet distinctive website that suits the demands of a
user like any other social media websites. The project created is a social media
web application where visitors may register and utilize the features exactly as
on other straightforward websites. The system will be built using the Django
web framework and the Bootstrap framework for the frontend design.

Dept. of CSE, NMAMIT Page 5


Social Media Website

HARDWARE / SOFTWARE Requirements

Hardware Requirements:

Django framework doesn't have many system requirements. Since it's primarily
written in python, the system requirements must satisfy to install Python
language. Similarly, SQLite3 can also run on any modern system. Hardware
requirements for this project are primarily concerned with the system hardware
requirements (PC). We recommend Intel Core i3 processor or above for the
development phase with a minimum 4GB PC Ram and HDD or SSD hard disk.
Server end hardware requirements aren't significant for this project because we
can host this project on the cloud with various services.

Software Requirements:

This social media application application uses python language for development
with SQLite database management system. We have used the Django
framework version 4.1.3 and hence we have to use python version 3.6 or above
and SQLite version 3.8 or above. The Integrated Development Environment used
for this project is Visual Studio Code.

Dept. of CSE, NMAMIT Page 6


Social Media Website

METHODOLOGY

The project will be developed using an iterative and incremental approach. The
first step will be to define the requirements and design the system architecture.
This will involve identifying the various components of the system and their
interactions, as well as defining the user flows and functionalities. Once the
requirements and design are finalised, the implementation phase will begin. This
will involve the development of the various components of the system, including
the user interface, database, and backend logic. The system will be tested and
refined throughout the development process to ensure that it meets the
requirements and provides a smooth and efficient user experience.

Django is an open-source web application framework written in python. It is a


high-level framework that encourages rapid development and clean, pragmatic
design. Django consists of three major parts: Model, View, and Template.

Model: Model is a single, definitive data source that contains the essential field
and behavior of the data. Python classes implement models. Usually, one model
is one table in the database. Each python object in the model represents a field
of a table in the database. Django provides a set of automatically generated
database application programming interfaces (APIs) for the convenience of
users.

Dept. of CSE, NMAMIT Page 7


Social Media Website

View: A view is a short form of the view file. It is a file containing a Python
function that takes web requests and returns web responses. A response can be
HTML content or XML documents or a “404 error” and so on. The logic inside the
view function can be arbitrary as long as it returns the desired response. To link
the view function with a particular URL, we need to use a structure called
URLconf that maps URLs to view functions.

Template: Django’s template is a simple text file that can generate a text-based
format like HTML and XML. The template contains variables and tags. Variables
will be replaced by the result when the template is evaluated. Tags control the
logic of the template. We also can modify the variables by using filters. For
example, a lowercase filter can convert the variable from uppercase into
lowercase. Django templates allow the developers to implement the front-end
logic of the application.

Step 1 : The UI for the project was designed using HTML, CSS, SCSS,
Bootstrap and Javascript.

Step 2: Once the frontend was designed a schema was created for different
models:

Dept. of CSE, NMAMIT Page 8


Social Media Website

Step 3: Views are written to write the underlying logic that needs to be displayed
on the frontend in views.py file and routes are configured in urls.py file.

IMPLEMENTATION

Installation Steps:

Step 1: Open VS Code or any other editor of your choice and Install virtualenv
using the command pip install virtualenv in the terminal.

Step 2: Run the below 2 commands:

virtualenv env

env/scripts/activate

Social Media Website Page 10


Social Media Website

Step 3 : Install all the requirements by running pip install -r requirements.txt

Step 4: Create database table by applying migrations

python manage.py makemigrations


python manage.py migrate

Step 5: Finally run the command python manage.py runserver

A development server will be started run the website in any browser and ensure
proper internet connection.

The Python and Django built in Functions used for the project:

 Python’s in built random function was used to shuffle the users randomly in
user suggestions section.

 Len function was used to find the number of posts posted by user, number
of followers etc.

Python query sets and SQL:

Social Media Website Page 11


Social Media Website

This section covers most of the Django query sets and raw SQL that have been
used in the blog application. Query sets are the list of objects that have been

created using the models. We can perform operations such as add, delete,
retrieval, and many more. It's implemented in python and can interact with
database tables.

• Filter method: filter() method is used when we need to perform queries with
certain conditions. We have used the filter method to filter the blogs based on
category.

• All method: The simplest way to retrieve an object (tuple) from the database
table is to call all() method when using query sets.

• __icontains method: The simplest way to search an object (tuple) from the
database table is to call __icontains() method when using query sets.

Generic Views: Writing web applications can be monotonous, because we


repeat certain patterns again and again. Django tries to take away some of that
monotony at the model and template layers, but web developers also experience
this boredom at the view level.

Views used:

 ListView : List View refers to a view (logic) to display multiple instances of


a table in the database.

 DetailView: Detail View refers to a view (logic) to display one instances of


a table in the database.

 CreateView : Create View refers to a view (logic) to create an instance of a


table in the database.

Social Media Website Page 12


Social Media Website

 PasswordChangeView: Django provides authentication and authorization.


For Changing Password you need to get authenticated first. In your urls.py,
we need to import PasswordChangeView from Django Auth. By default,
Django PasswordChangeView will render template
base/change_password.

 UpdateView: Update View refers to a view (logic) to update a particular


instance of a table from the database with some extra details.

 DeleteView: Delete View refers to a view (logic) to delete a particular


instance of a table from the database.

Models are created for each table with its attributes specified. The operations are
then done with inbuilt methods in Django.

CRUD in Django

● Inserting is done by the save() method

● Deleting with delete() method

● Updating with is done by changing the fields for the fetched object , again with
save() method

RESULTS AND DISCUSSIONS

Snapshots of the project:

Signup Page Login Page

Social Media Website Page 13


Social Media Website

Home Page and Comment Display Modal

Search user results page and User Profile Page

Social Media Website Page 14


Social Media Website

Create and edit user profile

Add and Update posts

Social Media Website Page 15


Social Media Website

Django Form-Validation

Django provides built-in methods to validate form data automatically. Django


forms submit only if it contains CSRF tokens. It uses uses a clean and easy
approach to validate data.

The is_valid() method is used to perform validation for each field of the form, it is
defined in Django Form class. It returns True if data is valid and place all data
into a cleaned_data attribute.

CONCLUSION AND FUTURE SCOPE

As the goal was set most of the implementations and requirements have be
passes and test cases been solved. Some problems for developer like error
correction did become a hassle as we are new to this subject, but at the end a
fruitful website was created together.
Future Scope can include integrating our application with a real time chat
application that could serve the demand of the users on a successful social
media web application.Working on the backend can be time-consuming and yet
can be simplified when working with the Django framework. SQLite3 provides a
robust and flexible Database Management System that is very suited for the
scalability of products.
Extensions or development of the database tables so that a better database can
be provided. No software is perfect, good maintenance an update to the trend is
what will make any software shine.
SQLite3 database works at its best, backed by the authentication and security
features of Django.

Social Media Website Page 16


Social Media Website

REFERENCES

 Django documentation: https://www.djangoproject.com


 Python documentation: https://docs.python.org
 Stack Overflow Solutions
 Sqlite3 documentaion https://www.sqlite.org/docs.html

Social Media Website Page 17


Social Media Website

Social Media Website Page 18

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