Uploaded by Harsh Patel

Summer Internship Report 180160116002

advertisement
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Report On Summer
Internship In Akash Technolab
Student Name
Faculty Mentor
Ayush Bhadouriya (180160116002)
Anil Prajapati
Submitted To
Department Of Computer Engineering & Information
Technology
Government Engineering College, Modasa
Year:2021
Page No: 1
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Page No: 2
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Certificate
This Is To Certify That Ayush Bhadouriya (180160116002), Of I.T. Has Successfully
Completed The Summer Internship (3170001) During 26th May 2021 To 9th June 2021.
Signature Of Faculty Mentor
Signature Of Head Of Department
Anil Prajapati
M B Chaudhari
Page No: 3
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Acknowledgement
I Would Like To Thank You Mr. Akash Padhiyar sir Who Give Me The Opportunity
To Work With His Company Akash Technolab, Also Very Grateful To Miss Devanshi Ma’am
Who Taught us All The Basics That We Need, And My Dear Friends Who Helped Me To
Solved Many Problems.
I Also Very Deeply Thankful To GTU And My College Because Of Their Summer
Internship Program I Have Learned Many New Things That Will Help Me In The Future.
Signature Of Student
Ayush Bhadouriya
(180160116002)
Declaration
Page No: 4
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
I, Hereby Declare That The Project/Work Submission Is My Own Work And That, To The
Best Of My Knowledge And Belief, It Contains No Code/Material Previously Published Or
Written By Another Person As A Part Of The Completion Of The Summer Internship.
Place: Government Engineering College, Modasa
Date: 17th June 2021
Signature Of The Student
Ayush Bhadouriya
180160116002
Page No: 5
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Page No: 6
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Abstract
The Summer Internship Program 2021 Which Was Design By GTU, It Was A First
Time That GTU Announce 15th day Internship Program Like This, So I Also Participate In
Online Internship Program And It Was End After 2 Weeks I Done My 2-week Internship In
Akash Technolab. This Company Developed Mobile And Web-based Application And I Gain
My First Industrial Experience As Web Programmer In Django. Django Is A Framework Built
In Python Language And I Learn Many Things During My Day To Day Task With Django,
And At The End Of The Internship I Was Able To Create Web App In Django Which I Created
With Some Authentication Functionality.
Page No: 7
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Index
Sr.No
Content
Page. No
1
Introduction
8
2
Problem Statement/Definition
9
Page No: 8
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
3
Tools/Technologies
10
4
Timeline Chart
11
5
Module Development/Implementation
48
6
Conclusion
52
7
References
53
Chapter-1
Introduction
It’s Been A Half Of A Year Since This Pandemic Begin And All The Universities And
Colleges Are Complete Their Work In Online Mode, Being All Day Home And Sitting At The
Same Place Every Day Is Very Boring And Sometime It Could Be Very Stressful To Just Stay
Home All Day And It’s Already Been Half Of A Year But Still We All Manage To Survive
That Time And This Summer GTU Introduce As New Program 15 Day Summer Internship, In
This Program We Had To Spend Our Summer Vacation With The Industries Which Means
We Had To Compulsory Complete This Program, And This Is Kind Of Very Beneficial To
Student In Terms Of Experience, Like How The Real Work Happens In Industries, And We
Did Complete The Program And I Learn So Much Thing We Will Be Definitely beneficial in
My Future.
Page No: 9
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
This Summer Internship Was 2 Weeks Long And Our Work In Akash Technolab
Divided In Two Phases. Since The Django Is Made In Python We Should Have The Basics
Knowledge Of Python Programming, So That Is Why Our Internship Divided In 2 Phases.
Each Phase Takes Minimum One Week To Complete, Phase One Contains The Basic
Knowledge Of Python And Phase 2 Contains The All That We Need To Know About Django,
How Django Is Made. How We Can Take Effective Work With Django. How We Can Make
Dynamic Web App With Django.
Page No: 10
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-2
Problem Statement/Definition
So, In Akash Technolab First Day Akash Sir Discuss About The Problems That Their
Company Solves And Give The Best Solution To Their Clients. And Most Of All How We
Can Develop This Skill To Overcome To Our Ability To Deal With Different Problems In
Different Programming Fields He Show Us A Request From Client Side As Problem That
They Need A Web App Just Like The Cowin Website Which Should Be Used For Getting
Appointments From The User And Give The Schedule For Meeting, After That We Discuss
How The App Should Work, How It Must Be Look Like But Getting Design Ready Could Be
Tricky Because Some Time Clients Have Their own Expectation.
All Though It Is Very Good To See How They Manage To Cut The Problems In Sort And
Then Deal With individually, Like Web App Must Have Database To Store The User Requests
For Appointment Then Front-End Work Like How The Web App Should Look Like Or We
Can Say User Interface (UI). So, After Cutting The Problem We Can Deal With It Very Easily.
Page No: 11
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-3
Tools/Technologies
⮚ Why We Need Technologies?
Every Problem In This Field Can Be Solve In Various Way We Can Have The Multiple
Solution For The Same Problem But Tools & Technology Make Real Difference Here, There
Are Many Technologies Like C, C#, C++, Java, JavaScript, python, ruby, php, Perl etc. Now
Every Technology Have Its Own Advantages And Disadvantages, In My Case I Had Chosen
Python, Now Here I Should Make This Clear That We Can Not Work With Python Directly
On Web Or Another Technology, Like Java So In Java We Can Not Apply The Solution
Directly On Web. We Need A Medium To Communicate With The Web And For That We All
Now HTML Comes In The Game, CSS For Designing Part And JS For Making Dynamic Web
Page. So Lets See If I Manage To Build A Simple App And Now I Have Some Logical Notes
Which Can Give An Optimal Solution to My Web App, So For That We Need Web Framework
Like Django, Flask Or Any Other It Could Be Depend On Various Technology But The Work
Is Same To Implement Our Ideas About Solution Into Work By Storing Or Collecting Data In
Backend.
⮚ About Django
In My Case I Had Done My Internship In Python Django, I Chose Python Because
Python Has A Tones Of Library To Work With And Making Your Ideas About Solving
Problems Makes It More Effective To Choose. Django Is A Python-based Free And Opensource Web Framework That Follows The Model–template–views Architectural Pattern. It Is
Maintained By The Django Software Foundation, An American Independent Organization
Established As A 501 Non-profit. Django Has A Huge Community And Reason Is Simple
Because Of Open Source License, For Every Problem We Face In Django Community And
Django Documentation Is There For Us To Provide Help.
Page No: 12
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-4
Timeline Charts
Summer Internship Was 2 Weeks Long, And In This 2 Week We Were Informed To
Have Basic Work 1 Week In Python And 2nd week Started With Django Framework. During
That Time, we Were Given Some Task To Do Our Practice To Make Our Idea About Python
And Django More Clear, All The Task Either Code Or Designing And Output Are Here Below.
DAY: 1
First Day We Started With Simple Registration Form, In HTML Form Is Very Basic
Need To Collect Any Particular Data. So, As You Can See Below Images, I Use Some CSS
To Make It Form Little Bit Attractive.
Input:
<Html>
<head>
<title>
Registration Page
</title>
</head>
<body style="background-image:
developer-wallpaper.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;">
url('/home/ayush/Downloads/76681-software-
<br>
<br>
<form>
<label> <b> Firstname:</b> </label>
<input type="text" name="firstname" size="10"/> <br> <br>
Page No: 13
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
<label> <b>Middlename: </b></label>
<input type="text" name="middlename" size="10"/> <br> <br>
<label> <b>Lastname:</b> </label>
<input type="text" name="lastname" size="10"/> <br> <br>
<label><b>
Course :</b>
</label>
</label>
<select>
<option value="Course">--select--</option>
<option value="JAVA">JAVA</option>
<option value="PYTHON">PYTHON</option>
<option value=".NET">.NET</option>
<option value="ANDROID STUDIO">ANDROID STUDIO</option>
<option value="DATA SCIENCE">DATA SCIENCE</option>
<option value="MACHINE LEARNING">MACHINE LEARNING</option>
</select>
<br>
<br>
<label>
<b>Gender :</b>
</label><br>
<input type="radio" name="male"/> Male <br>
<input type="radio" name="female"/> Female <br>
<input type="radio" name="other"/> Other
<br>
<br>
<label>
<b>Phone : </b>
</label>
<input type="text" name="country code" value="+91" size="2"/>
<input type="text" name="phone" size="10"/> <br> <br>
<b>Address: </b>
<br>
<textarea cols="80" rows="5" value="address">
</textarea>
<br> <br>
<b>Email: </b>
<input type="email" id="email" name="email"/> <br>
<br> <br>
Page No: 14
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
<b>Password:</b>
<input type="Password" id="pass" name="pass"> <br>
<br> <br>
<b>Re-type password:</b>
<input type="Password" id="repass" name="repass"> <br> <br>
<input type="button" value="Submit"/>
<br><br>
<br><br>
</form>
</body>
</html>
Page No: 15
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Output:
Page No: 16
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 2
On Day 2 We Started With Python Programming In Which We Perform Some Basic
Program Like Hello World Than How We Can Store Data In Variable In Python Where We
Don’t Need To Specify The Type Of Data Type Of The Variable, We Can Also Store String
In Variable Here Again No Need To Specify Any Data Type Than We Can Stored Same Values
In Multiple Variables By Just Simply Assigning Them In A Single Line. In Python Print Is A
Inbuilt Method For Printing Data.
Not Only That But Also We Learn About Many Data Structures Used In Python Like
List And Tuple, here As You Can See In Above Images That I Also Used Several Methods
Alongside With List And Tuple Like Isinstance() It Will Take 2 Parameters, Variable And Its
Data Type And This Method Return The Boolean Value Either The Given Data Type Is True
or False. As I Said Before We Can Store A String In Python Very Easily Here We Can See
That We Can Also Access Any Particular Sequence Character From The String, And The Most
Important Factor Comes Now Which Makes Python Different From The Other Programming
Languages, It Can Stored More Than One Data With Different Data Types Which Is Rarely
We Can See In Other Programming language. Like below Image We Can See That In List
There Are Data Stored Which Has Int, float And String Data Types. Also Same Goes For
Tuple Too, But We Can Not Change The Value In Tuple.
Input 2.1:
print("hello ! world")
"""this
is a example of
multi line comments"""
#this is a
#example of a single
#line comments
x = 50
y = 78.42
Page No: 17
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
z = "This is string"
print(x)
print("the value of y :",y)
print("Entered Text is ",z)
name = "AVENGERS"
print("hello ! my name is ",name)
#now lets update the value in NAME variable
name = "AYUSH BHADOURIYA"
print("Updated name is ",name)
a,b,c = 87,49.87,"Jon Snow"
print(a)
print("value of b is : ",b)
print("name that you entered is ",c)
p = q = s = 58
print("value of a is : ", p)
print("value of b is : ", q)
print("value of c is : ", s)
Page No: 18
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Input 2.2:
n1 = 50
print(n1, "is type of", type(n1))
n2 = 59.43
print(n2, "is integer number ?", isinstance(n2, int))
n3 = 2 + 8j
print(n3, "is complex number ?", isinstance(n3, complex))
name = "Nishit Suthar"
print("name is : ", name)
print(name[0])
print(name[2:6])
print(name[4:])
print(name * 2)
print("hello " + name + " how are you")
list = [43, 53.23, "Suthar Nishit"]
print(list)
Tuple = (43,"Jon","New York",78,34.1)
print("tuple[3] :",Tuple[3])
print("tuple[0:3] :",Tuple[0:3])
print("tuple[4:] :",Tuple[4:])
#here Curley braces describes that it is tuple
Page No: 19
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 3
We Learn About Loops In Python And Also If Statements Not Only That But We Also
Learn About Nested Loops And Nested If - Else Statements How We Can Use This To Make
Our Work Easy Not Only That But Python Offers Us A Method Called Input() which Is Used
For Getting Inputs From User Side And We Can Stored That Data Into Variables To Perform
Such Operation As We Need In Our Program.By Default Input() Method Take Inputs As A
String So If We Put Any Data And Do Arithmetic Operation Than It Will Be Not Done Cause
Of The String Data Type But We Can Convert The Data Type Into Int Or Into Float By Using
Int() & Float() Methods.
Also, In Loop Python Offers The Same While Loop And For Loop As The Same As
The Other Languages But Here In This Case For Loop Seems Little Bit Different Because It
Can Be Used With Range() Method Not Like Other Languages Where We Put I++, First Time
It Seems Little Bit Tricky But It Feet Perfectly With Python. We Can Use Else Statement With
For Loop As You Can See In Above Images I Used In One example. With If Statements We
Also Recall The Operations Like +,-,*,/ And Also XOR (Bit-wise) Operators To Deal With
Certain Problems It Could Be Beneficial.
Input:
n = input("Enter a number : ")
print("The value that you just entered : ", n)
n1 = int(input("enter number 1 : "))
n2 = int(input("enter number 2 : "))
ans = n1 + n2
print(ans)
Page No: 20
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
x = 46
y = 53
if x == y:
print("both numbers are equal")
elif x > y:
print("x is a greater number")
else:
print("y is a greater number")
i=0
while i < 5:
print("value is : ", i)
i += 1
list1 = ["world", "boston", "54"]
for i in list1:
print("value : ", i)
else:
print("none of elements left")
Page No: 21
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Output:
Page No: 22
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 4
We Learned About Functions, In Python Functions Are Very Similar To The Java
Programming, Off Course Because Of Python Follow The Pure Object Oriented Structure.
Now Functions Could Be Void Or Could Be Return Something Like Int Values Or Float
Values And Many more. Every Functions Take Arguments All Though It Is Not Necessary.
But There Are Some Differences Between Argument And Parameters Parameters Means
Putting Values When We Call The Function, And Arguments Means Putting Values During
The Declaration Of Function.
Well Below I Done Some Operation With The Function Like Print Something In
Functions And Now I Am Able To Use That Function As Many Time As I Want Without Any
Long Lines Of Repetition. Python Also Offers Arbitrary Arguments, *Args which Means If
The Number Of Arguments Is Unknown, Add A * Before The Parameter Name and Than No
Worries About The Arguments Which Means If The Arguments Are Multiple Than Python
Handle Them By Itself. And Also We Can Assigned The Key Value Pair Of Arguments Like
If We Used Dictionary Data Structure Then We Can Stored Any Particular Data Into Specific
Key, So By That Mean If You want to Access That Data You Can, By Simply Accessing It’s
Key Into Function.
One Thing More That We Can Define Our Own Module In Python And Than We Can
Use That As Many Time As We Want By Simply Putting Import [Module] or If We Want
Any Particular Function Than Just Typing From [Module] Import [Function] Into Our
Program.
Page No: 23
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Input:
def function():
print("welcome to the python programming")
function()
function()
print('# ------------------')
def function1(string):
print("entered string is ", string)
function1("Hello I am AYUSH")
print('# ------------------')
def function2(name):
return name
stored_string = function2("Nishit")
print(stored_string)
print('# ------------------')
def functionQ():
name = "welcome"
number = 9428999420
return name, number
name, number = functionQ()
print("name :", name)
print("number :", number)
print('# ------------------')
Page No: 24
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
def sum(a=10, b=20):
print(a + b)
sum(19, 23)
sum()
print('# ------------------')
def sum1(a,b):
print('sum is : ',a+b)
sum1(a=18,b=32)
print('# ------------------')
def num(*value):
sum = 0
for n in value:
sum += n
print("sum : ", sum)
num(10, 20,30)
print('# ------------------')
def func(**arg):
for i, j in arg.items():
print(i, j)
func(name="AYUSH", surname="BHADOURIYA")
print('# ------------------')
def functionZ():
x = 30
print("value of local variable is : ", x)
Page No: 25
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
x = 20
functionZ()
print("value of global variable : ", x)
print('---------------')
import task11A as ns
name = ns.func("AYUSH BHADOURIYA")
print(name)
Output:
Page No: 26
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 5
So At The End Of The Week We Learn About OOP Concepts In Python, classes
Inheritance Method overriding, method Overreading Etc.As We Can See In Above Images I
Created Some Basic Class And Access It By Creating Object. Objects Are Nothing But Type
Of Variables Which Contains Specific Methods Or Classes With The Help We Can Access
Various functions, methods Of The Different Classes. So, This Is The End Of Our 1st week In
Akash Technolab And From The 2nd week We Started Our Journey To Learn
Input:
class MyClass:
x=5
print(MyClass)
class MyClass1:
x=5
p1 = MyClass1()
print(p1.x)
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
print(p1.name)
Page No: 27
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
print(p1.age)
class Person1:
def __init__(self, name, age):
self.name = name
self.age = age
def myfunc(self):
print("Hello my name is " + self.name)
p1 = Person1("John", 36)
p1.myfunc()
Output:
Page No: 28
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 6
⮚ What is Django?
Django Is A Python-based Free And Open-source Web Framework That Follows The
Model–template–views Architectural Pattern. It Is Maintained By The Django Software
Foundation, An American Independent Organization Established As A 501 Non-profit.
⮚ What is Model-Template-View?
The MVT (Model View Template) Is A Software Design Pattern. It Is A Collection Of
Three Important Components Model View And Template. The Model Helps To Handle
Database. ... The View Is Used To Execute The Business Logic And Interact With A Model
To Carry Data And Renders A Template.
So, Django Is Basically Strictly Follow the MVT Structure.
Page No: 29
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
⮚ How to install Django in our machine?
We Need Python And Pip Already Installed In Our Machine For Installing Django.
And For Creating Our First Project In Django We Need To Run A Simple Command
After Running That Command We Can See Some Files As You Can See Below.
Page No: 30
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
After Creating Our First Project We Need To Create Some Folders Like Static,
template Etc. In Static Folder We Saved Our All CSS Files And Js Files And In Template
Folder We Put Our HTML Files For Rendering. Here One More Folder We Can See Which Is
Myapp Now This Is Called App Which I Created In My Django Project And Creating Apps
In Django Make Things Easy To Work. For Creating App In Django We Need To Run
Command Which Is Like
✔ Python Manage.Py Startapp [App Name]
Here Manage.Py File Created Automatically When We Created Our Project It Contains All
The Functionality Which Help Us To Create Our App Or Either For Running Local Server.
Hello World in Django:
views.py
Input:
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("Hello ! World")
Urls.py(admin)
Input:
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path("", include("world.urls"))
]
Page No: 31
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Urls.py(our app)
Input:
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="home"),
]
Now Here Above Path That We Set Is In Our Project File, And We Also Had Our App
Folder Where We Need To Create A Urls.Py File So We Can Show Our Path That Render The
Http Response Which We Created In View.Py So It Is Something Like This
Also, One Important Thing To Do Add Our App Name Into Setting.Py
Page No: 32
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Output:
Page No: 33
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 7
This Is My Theme Integration In Django Project Here Django Has Some Functionality
Which Is Very Useful For This Kind Of Websites Here We Can See That We Had Total 3
Pages, home, Contact And About. And We Use The Same Layout For Every Single Page So
For A Second If We Create This In Only HTML Than It Could Be Like Some Much
Redundancy Same Code Again And Again May Be Chances Of Meshing Up Is High. But In
Django We Only Create One Page For Page Layout Like We Can See In Above Images Where
I Write My Whole Code In A Single File Called Base.Html So If I Wanted To Add Another
Page In My Layout I Will Used Jinja Templates.
⮚ What Is jinja?
Jinja Is A Web Template Engine For The Python Programming Language. It Was
Created By Armin Ronacher And Is Licensed Under A BSD License. Jinja Is Similar To The
Django Template Engine But Provides Python-like Expressions While Ensuring That The
Templates Are Evaluated In A Sandbox.
So If We Wanted To Extend Any Base Layout We Used {Extend ‘File.Html’}
And Also There Are Many Other Jinja Sand Boxes Which Are Very Helpful Like {Block
Content}{endblock} now If I Want To Add Something Into My Page But At Very Specific
Point And I Don’t want to Mesh Anything Else, Than I Will Create A Block And Create Every
Thing In It.So I Can Manage My Divisions Very Easily Like Here I Shared Below Some
Images In Which Page Layout Remains Same But One Division Changes For About And For
Contact.
Page No: 34
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Base.html Input:
{% load static %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Free Alpha Studio Web Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link href="{% static 'style.css' %}" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div id="header">
<div id="header_left">
<div id="logo">
<h1>My Learning Point</h1>
<h2>Alpha Studio</h2>
</div>
<div id="search">
<form method="get" action="#" accept-charset="utf-8">
<input type="text" class="text" />
<input type="submit" class="submit" value="" />
</form>
</div>
</div>
<div id="menu">
Page No: 35
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
<ul>
<li><a href="/">home</a></li>
<li><a href="about">about us</a></li>
<li><a href="contact">contact us</a></li>
<li><a href="form">form</a></li>
</ul>
</div>
</div>
<div id="middle">
<div id="left">
<h3>Technologies</h3>
<div class="box_sm1">
<div class="box_sm2">
<ul>
<li><a href="#">python</a></li>
<li><a href="#">PHP</a></li>
<li><a href="#">C++</a></li>
<li><a href="#">JAVA</a></li>
<li><a href="#">Ruby</a></li>
<li><a href="#">javascript</a></li>
<li><a href="#">aspnet</a></li>
</ul>
</div>
</div>
<h3>FrameWorks</h3>
<div class="box_sm1">
<div class="box_sm2">
<ul>
<li><a href="#">NodeJS</a></li>
<li><a href="#">Django</a></li>
<li><a href="#">Flask</a></li>
Page No: 36
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
<li><a href="#">Angular</a></li>
<li><a href="#">React</a></li>
<li><a href="#">Bootstrap</a></li>
<li><a href="#">Express</a></li>
</ul>
</div>
</div>
</div>
{% block content %} {% endblock %}
<div id="footer">
<p>
<a href="#">lorem</a> | <a href="#">ipsum</a> |
<a href="#">dolor sit amet</a> | <a href="#">maecenas</a> |
<a href="#">venenatis</a> | <a href="#">rhoncus nulla</a>
</p>
<p id="copyinfo">
Copyright © Your Name, Designed by
<a href="http://www.alphastudio.pl" target="_blank">Alpha Studio</a>
</p>
</div>
</div>
</body>
</html>
Home.html Input:
{% extends 'base.html' %} {% load static %} {% block content %}
<div id="right">
Page No: 37
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
<h3>Terms of use</h3>
<div class="box1">
<div class="box2">
<p>
<img
class="imgLeft"
src="{% static 'images/image2.jpg' %}"
width="240"
height="160"
alt=""
/>This is a home page folks
</div>
</div>
</div>
</div>
{% endblock %}
About.html Input:
{% extends 'base.html' %} {% load static %} {% block content %}
<div id="right">
<h3>Terms of use</h3>
<div class="box1">
<div class="box2">
<p>
<img
class="imgLeft"
src="{% static 'images/image2.jpg' %}"
width="240"
Page No: 38
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
height="160"
alt=""
/>This is a home page folks
</div>
</div>
</div>
</div>
{% endblock %}
Contact.html Input:
{% extends 'base.html' %} {% load static %} {% block content %}
<div id="right">
<h3>Terms of use</h3>
<div class="box1">
<div class="box2">
<p>
<img
class="imgLeft"
src="{% static 'images/image2.jpg' %}"
width="240"
height="160"
alt=""
/>This is a contact page folks
</div>
</div>
</div>
</div>
{% endblock %}
Page No: 39
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Home.html Output:
About.html Output:
Page No: 40
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Contact.html Output:
Page No: 41
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 8
I Created A Simple Form By Extending My Main Page Layout Which Contains The
Theme, And Than In My View.Py File I Write A Method Which Collects The Data From The
User Entered In Form And Stored Into Variables And Than I Perform Simple Addition And
Return It’s value. AS We Can See In Above Images I Also Created One Sign Up Page For
Which I Write Another Method In My View.Py File I Also Created Paths For Every Single
Method That I Created In Urls.Py File Which Seem Like This.
urls.py Input:
from django.urls import path
from . import views
urlpatterns = [
path("", views.homepageview, name="home"),
path("about", views.aboutpageview, name="about"),
path("contact", views.contactpageview, name="contact"),
path("form", views.formpageview, name="form"),
path("process", views.processpageview, name="process"),
path("signup", views.signuppageview, name="signup"),
path("Udata", views.userdataview, name="userdata"),
path("slist", views.student_list.as_view(), name="slist"),
]
Page No: 42
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Views.py Input:
from myapp.models import Student
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import ListView
from .models import Student
def homepageview(request):
return render(request, "home.html")
def aboutpageview(request):
return render(request, "about.html")
def contactpageview(request):
return render(request, "contact.html")
def formpageview(request):
return render(request, "form.html")
def processpageview(request):
print("welcome")
print(request.method)
print(request.POST)
a = int(request.POST["num1"])
b = int(request.POST["num2"])
Page No: 43
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
c=a+b
print(c)
return render(request, "sum.html", {"mya": a, "myb": b, "mysum": c})
def signuppageview(request):
return render(request, "signup.html")
def userdataview(request):
print("user fulfilled form")
print(request.method)
print(request.POST)
fname = request.POST["first_name"]
lname = request.POST["last_name"]
email = request.POST["email"]
sub = request.POST["subject"]
mobile = int(request.POST["phone"])
return render(
request,
"userdata.html",
{
"my_fname": fname,
"my_lname": lname,
"myemail": email,
"sub": sub,
"my_mobile": mobile,
},
)
Page No: 44
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
class student_list(ListView):
model = Student
template_name = "slist.html"
# Create your views here.
Frontend Output:
Page No: 45
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Backend Output:
Here, I Created Two Different Methods One For Storing All The Data That Coming
From Sign-up Form That I Created We Can See In Above Image, I Used POST Method For
Getting Information, That Is Why I Used Request.POST Method And Stored All Individual
Data Into Variable.
After The Storing All The Data I Used Listview Method Which Will Show All The Stored
Data On The Blank Page That I Render Through Student_list Class. As We Can See In The
Output Image.
Page No: 46
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
DAY: 9
⮚ What Is Model In Django?
A Model Is The Single, Definitive Source Of Information About Your Data. It Contains
The Essential Fields And Behaviors Of The Data You're Storing. Generally, Each Model Maps
To A Single Database Table. With All Of This, Django Gives You An Automaticallygenerated Database-access API.
By default, Django Uses Sqlite3 Database For Storing Data, In Sort Model Is Just The
Python File Which Contains The Information About The Database Table, How Table Should
Be Organize In Database Etc.
⮚ What is Migrations ?
Migrations Are Django's Way Of Propagating Changes You Make To Your Models
(Adding A Field, Deleting A Model, Etc.) Into Your Database Schema. They're Designed To
Be Mostly Automatic, But You'll Need To Know When To Make Migrations, When To Run
Them, And The Common Problems You Might Run Into.
So, If We Create Table Or Class For Our Database In Model.Py File And After That If
We Avoid Migration Step Than It Worth Nothing Or In Other Words Our Database Will Not
Made In Back End So If Want To Make Database In Django, We Compulsory Need To Run
Below Two Commands.
✔ python manage.py makemigrations
✔ python manage.py migrate
In Django We Had A Inbuilt Admin Panel, So No Need To Create Admin Panel For Our
Database But We Must Have To Create Superuser In Order To Manage & Access That Page.
✔ python manage.py createsuperuser
Page No: 47
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
By Running This command, We Can Create Super User in Just Minute.
Here, Below Image We Can See That In Authentication And Authorization Panel Already Two
Tables Are Given And Below That I Created Database For Student Detail Which Is Shown.
Django Also Comes With Inbuilt Authentication Functionality, So If We want to Create Any
Login Page Or Sign-up With Authentication, We Can Create That Very Easily.
Output:
Page No: 48
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-5
Module Development/Implementation
At The End of My Summer internship, I Have Created Mini-project, With Fully Authentication
Functionality of Sign Up & Login. If You Are Already A User Than You Can Directly Login
To The App Otherwise You Need To Create Your User Account In My App Via Sign Up Page,
After That Process You Will Redirect To The Page Called Dashboard Or Home Page, In Which
I Did A Crud Operation.
Details About Employee Like Their Salary, Name, Email, Phone etc., You Can Use This App
As A Record Book. In A Way of Using, It Is Prety Much Simple.
Output:
Page No: 49
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
My_logic Output:
If Somebody Has Not Sign Up Before And Tried To Open Homepage Than It Will Be
Redirect To The Login Page In Above Image You Can See The Login That I Have Used If
You Don’t Have User Account Than You Can Sign Up And Create New User Account And
Than You Can Login With That Credential.
Page No: 50
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Output:
Output:
Here I Have Written 4 Different Methods For Adding Data Into Database And Also
Retrieving The Same Data Into Screen. Than For Deleting Records I Have Used Inbuilt
Method Delete(),for Updating The Data I Have Created Update_data().
Here I Used Form-model API For Creating Form. Which Means I Directly Created
Forms.Py File And Access It Through Model.Py File To Adding Data Into Database. And For
Database I Have Used The Default Database Sqlite3.
Page No: 51
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-6
Conclusion
At The End Of Summer Internship Program I Am Now Able To Work In Django Framework
Without Any Hesitation, I Can Create Database In Sqlite3 Which Is Default Database In
Django, With That I Can Surely Stored Any Data That I Want And With The Solving Ability
I Can Able To Solve Any Particular Problem, Thanks To Akash Technolab For encouragement
And All Industrial Level Training. This Is Program Started By GTU This Year Is Very
appreciable.
Page No: 52
Ayush Bhadouriya
GTU Summer Internship
En. No: 180160116002
Chapter-7
References
Here Below I Provide All The Links That I Use During My Summer Internship
✔ https://stackoverflow.com/
✔ https://www.djangoproject.com/
✔ https://akashpadhiyar.com/
✔ https://www.youtube.com/
✔ https://www.w3schools.com/
✔ https://github.com/
Page No: 53
Download