What is Django + Installing Django
By Guru - May 03, 2021
1. What is Django
Django is a Python based web development framework which is used for
developing efficient web applications. It is free and open source web
application framework. A framework is a set of components that helps you to
develop websites faster and easier.
Django is based on MVT (Model-View-Templates) architecture.
Model : Model is used to handle logical data structure of the
application and is represented by database.
View : A view is user interface when you render a website. A view
function is python function that takes web request and return a Web
response.
Templates : A template is actually a HTML file which is rendered
as response of view function. It consists is static as well as dynamic
content of webpage. Special syntax is used for dynamic content in
template.
Why Django Framework?
- Open source and good documentaion.
- Simple, Fast and Easy to understand.
- Secure and well organised.
- Cross platform meaning your project can be based on Mac, Linux,or Windwos.
- Backend management with built-in admin panel.
- Middleware support.
- Numbers of addtional packages available.
- Large scalability.
- Popular sites using Django : Instagram, Spotify, Dropbox, Pinterest, Reddit and many more.
2. Instaling Django
To install django first you need python3 in your system. if python3 is not installed in your system, install it from here.
Note : Installation of Django in Linux,Mac and Windows is
similar.
After installing python3 in your system, open terminal/command prompt and
go through following commands.
- Install pip : pip is a package manager for python. It is used for installing addtional libraries and dependencies.
python -m pip install -U pip
- Install virtual environment : Python virtual environment is the an isolated environment for python projects.
pip install virtualenv
- Setup virtual environment
virtualenv venv
- Activating virtualenv
. venv/bin/activate
- Install Django
pip install django
Wrap up
Commands used :
python -m pip install -U pip
pip install virtualenv
. venv/bin/activate pip
install django
pip install virtualenv
. venv/bin/activate pip
install django
0 Comments