Why Django Framework ?
Why Django Framework ?
Django architecture
Features of Django
Versatility of Django
Django can build almost any type of website. It can also work
with any client-side framework and can deliver content in any
format such as HTML, JSON, XML etc. Some sites which can
be built using Django are wikis, social networks, new sites etc.
Security
Since Django framework is made for making web development
easy, it has been engineered in such a way that it automatically
do the right things to protect the website. For example, In the
Django framework instead of putting a password in cookies, the
hashed password is stored in it so that it can’t be fetched easily
by hackers.
Scalability
Django web nodes have no stored state, they scale horizontally
– just fire up more of them when you need them. Being able to
do this is the essence of good scalability. Instagram and Disqus
are two Django based products that have millions of active
users, this is taken as an example of the scalability of Django.
Portability
All the codes of the Django framework are written in Python,
which runs on many platforms. Which leads to run Django too
in many platforms such as Linux, Windows and Mac OS.
Installation of Django
Step1: Install pip using (python -m pip install -U pip)
Step2: Install virtual environment using (pip install virtualenv)
Step3: Set virtual environment
1. Create virtual environment using (virtualenv env_site)
2. Change directory to env_site using (cd env_site)
3. Go to Script directory and activate virtual environment
using (cd Script && activate)
Step4: Install Django using (pip install django)
Step5: Return to env_site directory and start project by using
(django-admin startproject geeks_site)
Step6: cd geeks_site
Step7: Start server using (python manage.py runserver)
Step8: http://127.0.0.1:8000/
Project Structure :
A Django Project when initialised contains basic files by default
such as manage.py, view.py, etc. A simple project structure is
enough to create a single page application.
cd projectName
path('geek/', hello_geek),
Now to run the server follow these steps-
Open command prompt and change directory to env_site
by this command-
$ cd env_site
$ cd Script
$ activate
$ cd ..
$ cd geeks_site