Django Web Framework is the name came after django Reinhardt , a guitarist in 1950’s. The following companies uses django : Discuss,Instagram,Pinterest ,The Washington post ,Bitbucker ,Nextdoor and Mozilla. The main reason behind to use is , django is a stable ,easily scalable and which clearly separate component such as database layer and application layer. Using Django web framework we can easily build Web page in simple 7 steps.
Django is a python based very versatile web framework used for crating the web application in less time, it is free and opensource. Django follows the MVT(Model View Template) type of architecture for designing the web page, it is mainly used for database targeted websites .Django uses the concept of template inheritance , means first load the template called ‘base’ and followed by other blocks.
Security in Django Web Framework
Django is gaining famous for it’s security features in web application creation,they are as follows,
- Cross site scripting Protection : Django protects against the majorty of XSS attacks : which allows a user to insert client side scripts into the browser of the other users.
- Protects against cross site request forgery protection (CSRF) : CSRF attack allows a malicious user to execute actions using the credentials of another user without that user’s knowledge or approval. Django has built in protection against most types of CSRF attacks ,providing you have enabled and used it where appropriate .CSRF protection works by checking for a secret in each POST request.
- SQL Injection protection: SQL injection is a type of attack where a malicious user is able to execute arbitrary SQL code in a database.
- Click jacking Protection: Click jacking is a type of attack where a malicious site wraps another site in a frame .This attack can result in an unsuspecting user being tricked into performing unintended actions on the target site. Django contains click jacking protection in the form of the X-frame options middle ware.
- Deploying the site using HTTPS.
- Host header validation.
- Session content.
It is a world class geographic web framework . The main intention is to make it as easy as possible to build GIS web application and harness the power of spatially enables data.
Django provides tools to do the following tasks:
- Authentication , caching, Logging, Sending e mail , syndicate feed , pagination.
- Message framework , serialisation.
Step by step procedure to create a web page in Django is given below:
- Install the Django framework in your machine
2) To run the server use the following command :
pyhton manage.py runserver in the command prompt .
3) To create application use following command :
django-admin startapp app-name.
4) create a urls.py and in views.py add (‘ ‘ ,views.home, name = ‘home.page’).
5) add the home definition in views of app folder.
6) To create a templates : Create a template folder
7) Create the html file ,which contains dynamic data .
8) add the path of template in settings.py of project .
for ex: ‘DIRS’ : [os.path.join(BASE_DIR , ‘template’].
By following the steps ,we can able to create the simple web application using Django web framework.
Ok , In next post I will provide adding form and database connection to a web page using django.
That’s all now,
I hope you liked my post , please provide the comment / suggestion for my post .