Advanced Python Notes (Unit - 1)
Advanced Python Notes (Unit - 1)
❖ History
➢ Django was created in the autumn of 2003, when the web programmers at the Lawrence
Journal-World newspaper, Adrian Holovaty and Simon Willison, began using Python to
build applications. Jacob Kaplan-Moss was hired early in Django's development shortly
before Simon Willison's internship ended.[16] It was released publicly under a BSD license
in July 2005. The framework was named after guitarist Django Reinhardt.[17] Adrian
Holovaty is a Romani jazz guitar player inspired in part by Reinhardt's music.[18]
➢ In June 2008, it was announced that a newly formed Django Software Foundation (DSF)
would maintain Django in the future.[19]
❖ Introduction
❖ Features of Django
• Rapid Development
➢ Django was designed with the intention to make a framework which takes less time to build
web application. The project implementation phase is a very time taken but Django creates
it rapidly.
• Secure
➢ Django takes security seriously and helps developers to avoid many common security
mistakes, such as SQL injection, cross-site scripting, cross-site request forgery etc. Its user
authentication system provides a secure way to manage user accounts and passwords.
• Scalable
➢ Django is scalable in nature and has ability to quickly and flexibly switch from small to
large scale application project
• Fully loaded
➢ Django includes various helping task modules and libraries which can be used to handle
common Web development tasks. Django takes care of user authentication, content
administration, site maps, RSS feeds etc.
• Versatile
➢ Django is versatile in nature which allows it to build applications for different-different
domains. Now a days, Companies are using Django to build various types of applications
like: content management systems, social networks sites or scientific computing platforms
etc.
• Open Source
➢ Django is an open source web application framework. It is publicly available without cost.
It can be downloaded with source code from the public repository. Open source reduces
the total cost of the application development.
• Complexity
➢ With time, the MVC architecture pattern updates with a new extent of indirection through
its updates. This further builds up the complexity of the solution. Moreover, the User
Interface Code increases and thus creates an issue while debugging it.
• It’s secure
➢ Security is also a high priority for Django. It has one of the best out-of-the-box security
systems out there, and it helps software engineers avoid common security issues, including
• It’s well-established
➢ Django is very good for web development. It is time- and crowd-tested. It has a big,
supportive community accessed through numerous forums, channels, and dedicated
websites. It’s easy to find help when there’s a problematic function in the code and to find
specialists if your company is looking to base the next project on Django.
Model
➢ The model is going to act as the interface of your data. It is responsible for maintaining
data. It is the logical data structure behind the entire application and is represented by a
database (generally relational databases such as MySql, Postgres)
View
➢ The View is the user interface — what you see in your browser when you render a website.
It is represented by HTML/CSS/Javascript and Jinja files.
Template
➢ A template consists of static parts of the desired HTML output as well as some special
syntax describing how dynamic content will be inserted.
❖ Installation of Django & Create Virtual Environment
• Virtual Environment
➢ It is suggested to have a dedicated virtual environment for each Django project, and one
way to manage a virtual environment is venv, which is included in Python.
➢ The name of the virtual environment is your choice, in this tutorial we will call it myworld.
• type the following in the command prompt, remember to navigate to where you want
to create your project
➢ py -m venv myworld
❖ Installation of Django
➢ Now, that we have created a virtual environment, we are ready to install Django.
• Install Django
➢ pip install Django
• check Install or Not Django
import django
django.__version__
'5.0.7'