Professional Documents
Culture Documents
SESSION 2019-2020
ON
“Advanced Python with Django”
Submitted By
Nishant Deheriya
(0115CS161050)
0
INDEX
S No Content Page No
1 COMPANY PROFILE 03
2 TRAINING SUMMARY 03
3 ACKNOWLEDGEMENT 04
4 COURSEDESCRIPTION 05
5 LEARNING OUTCOMES 05
6 Python Basic 06
7 VARIABLES TYPES AND 07
PROPRETIES
14 SENDING EMAIL 16
15 MAKE COMPLETE E- 17
COMMERCE
1
Certificate
2
COMPANY PROFILE
TechSim plus is one of the world’s leading training providers. It partners with companies and
Indian Institutes to provide training and coaching helps students and working professionals to
achieve their career goals.
It is a learning platform that provide instructor led classroom training on Industry relevant
technologies like Data Analytics, Deep Learning, Artificial Intelligence, Machine Learning,
Advanced Python with Django, Data Science, IOT &Raspberry Pi- 3, etc.
TRAINING SUMMARY
We have done our Industrial Training on Core+ Advanced Python with Django from
TechSim+, Bhopal by trainers Prateek Mishra and Nikita Choudhary in time duration 15
July to 12 August 2019.
This institute provided me good training focusing mainly on practical knowledge. It also
guided me in making a project “E-Commerce” on Python using Django platform.
3
ACKNOWLEDGEMENT
The internship opportunity I had with “TECHSIM+” was a great chance for learning
andprofessional development. Therefore, I consider myself as a very lucky individual as I
was provided with an opportunity to be a part of it. I am also grateful for having a chance to
meet so many wonderful people and professional who led me though this internship period.
It is my radiant sentiment to place on record my best regards, deepest sense of gratitude to
MR.PRATEEK MISHRA for their careful and precious guidance which were extremely
valuable for my study both theoretically and practically. I perceive as the opportunity as a big
milestone in my career development.
4
COURSE DESCRIPTION
Python has been one of the premier, flexible, and powerful open-source language and is easy
to learn, easy to use, and has powerful libraries for data manipulation and analysis. For over a
decade, Python has been used in scientific computing and highly quantitative domains such as
finance, oil and gas, physics, and signal processing. The training is a step by step guide to
Python and Django (Web Development) with extensive hands on. The course is packed with
several activity problems and assignments and scenarios that help you gain practical
experience. At the end of this training you will be master in Python and Web Development
with Django.
LEARNING OUTCOMES
Gain insight into the 'Roles' played by a Python Developer.
Get Certified by IIT'S and NIT's.
Work on Real Projects.
Training based Hands on Practical and Projects
Get one year Membership with TechSim +
Placement Opportunity in Core Python Companies
Understand our course’s outline
Know some basic concepts about Python programming language (built in types,
statements, class, Exception Handling,…)
Can write some simple python program
Know the use of Python /Django in today’s world
Shopping:
_int.py
Settings.py
Urls.py Sms:
_int_.py
Admin.py
Models.py
Tests.py urls.py
5
views.py
manage.py
CURRICULUM
OVERALL PYTHON /DJANGO COURSE
Part4:Models
Parts5:Querysets
Part6:URL Configuration and Request/Response(Views)
Part7:Django Templates
Part8:Admine Sites
Part9:Forms
Part10:File Uploads & Generic View
Deployment
WHAT IS PYTHON
PROGRAMMING LANGUAGE
Python is powerful... and fast; plays well with others; runs everywhere; is friendly & easy to
learn; is Open. These are some of the reasons people who use Python would rather not use
anything else.
6
Python can be easy to pick up whether you're a first time programmer or you're experienced
with other languages.following pages are a useful first step to get on your way writing programs
with Python! Beginner's Guide, Programme Beginner's Guide, Non-Programmers Beginner's
Guide, Download & Installation Code sample and snippets for Beginners.
The community hosts conferences and meet ups, collaborates on code, and much more.
Python's documentation were Conferences
And Workshops Python Documentation Mailing Lists and IRC channels.
Open source:
Python is developed under an OSI-approved open source license, making it freely usable and
distributable, even for commercial use. Python's license is administered by the Python
Software For.
SRTINGS
String literals in python are surrounded by either single quotation marks, or double quotation
marks.Strings can be output to screen using the print function.
For example:
1. >>> x*5
'HelloHelloHelloHelloHello
PROPRITES
Besides numbers, Python can also manipulate strings, which can be expressed in several ways.
They can be enclosed in single quotes ('...') or double quotes ("...") with the same result. \ can
be used to escape quotes:
SLICING
Slicing creates a slice of an object representing the set of indices specified by range (start :
stop : step).
7
x = 'Hello Python >>>
x[4:9] 'o Pyt'
>>>x[6:] 'Python'
>>>x[:9] 'Hello Pyt'
By default split function splits from space ( ), but we can also pass a parameter if we want to
split the string from any particular character.
list() function is used to convert a string into list taking individual character (including space)
as elements. For Example:
>>> x = 'Hello Python'
>>> list(x) ['H', 'e', 'l', 'l', 'o', ' ', 'P', 'y', 't', 'h', 'o', 'n']
join() function is used to join elements of a list to create a whole string.
LOGICAL,BOOLEAN EXPRESSION
• Equals: a = b
• Not Equals: a !== b
• Less than: a < b
• Less than or equal to: a <= b
• Greater than: a > b
• Greater than or equal to: a >= b
For loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or
a string).A for loop can execute a set of statements, once for each item in a list, tuple, set.
With the break statement we can stop the loop before it has looped through all the items. With
the continue statement we can stop the current iteration of the loop and continue with the next.
The else keyword in a for loop specifies a block of code to be executed when the loop is
finished.
8
While loop can execute a set of statements as long as a condition is true. The while loop requires
relevant variables to be ready.
Break statement can stop the loop even if the while condition is true.
Continue statement can stop the current iteration and continue with the next iteration.
MULTIPLE ASSIGNMENT
MORE ON LISTS:
The list data type has some more methods. Here are all of the methods of the lists objects.
List .extend(iterable)
Extend the list by appending all the items from the iterable. Equivalent to a [ len (a) :] =
iterable
List .insert(i,x)
Insert an item at a given position. So, a. insert (0,x)
List .remove(x)
Remove the first item from the list whose value is equal to x. it raises a valueError if there is
no such item.
List .pop([i])
Remove the item from the given position in the list, and return it. A.pop () removes and returns
the last item in the list.
FOR LOOP:
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set,
or a string). This is less like the for keyword in other programming languages, and works more
9
like an iterator method as found in other object-orientated programming languages. With the
for loop we can execute a set of statements, once for each item in a list, tuple, set etc.
>>> for i in Name:
print(i) Sourabh
Mahesh
Pranay
Arpit
Lovelesh
Anirudh
The else keyword in a for loop specifies a block of code to be executed when the loop is
finished.
Print all numbers from 0 to 5, and print a message when the loop has ended.
for x in range(6): print(x) else:
print("Finally finished!")
LAMBDA FUNCTION
Lambda Expressions Small anonymous functions can be created with the lambda keyword.
This function returns the sum of its two arguments: lambda a, b: a+b. Lambda functions can be
used wherever function objects are required. They are syntactically restricted to a single
expression. Semantically, they are just syntactic sugar for a normal function definition. Like
nested function definitions, lambda functions can reference variables from the containing
scope.
>>> def make_incrementor(n):
return lambda x: x + n >>> f =
make_incrementor(42)
>>>f(0) 42
>>>f(1) 43
STRING FORMAT
10
The brackets and characters within them (called format fields) are replaced with the objects
passed into the str.format() method. A number in the brackets can be used to refer to the position
of the object passed into the str.format() method.
NESTED FUNCTIONS:
The initial expression in a list comprehension can be any arbitrary expression, including another
list comprehension.
Consider the following example of a 3x4 matrix implemented as a list of 3 lists of length 4:
>>> matrix =[1, 2, 3, 4]
[5, 6, 7, 8]
[9, 10, 11, 12]
The following list comprehension will transpose rows and columns:
GENERATOR EXPREESSION
OOP PROGRAMMING
11
STEP - 5: EXCEPTION HANDLING IN PYTHON
UNDERSTANDING EXCEPTION
Since the try block raises an error, the except block will be executed. Without the try block, the
program will crash and raise an error.
You can use the else keyword to define a block of code to be executed if no errors were raised.
The finally block, if specified, will be executed regardless if the try block raises an error or not.
12
STEP - 9: URLS VIEWS & FORMS
13
Fig 1.2 Models.py
14
Fig 1.3 login.html
15
Fig 1.4 Login.html
Quick example
Send Mail()
The Email Message class
Email backend
Configuring email for development
16
Fig 1.5 order placed
Start Project
Connecting Templates
Make Models
Create Add to Cart
Check Out
Add Payment Method
Integrate Payment Gateway
Integrate SMS Gateway
Add Admin Panel
Add Category and Products
Track New Orders
Make Live your Project
17
Fig 1.6 models.py
18