We know Django is the python framework ,so it only work with python installed system,before starting Django we should install python.So lets see how to install python in windows 10. Fortunately installing python is so easy
Install python in windows 10
First you need to get the python installer,as of now latest python version that support Django is Python 3.6.7. Go to https://www.python.org/downloads/ and Download Python 3.6.7 and install don’t forget to tick add python 3.6 tp PATH,it will assign PATH variable
Check python installed successfully
open CMD in windows
will respond like below
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
install pip if not installed in your system
Create a project directory, you can create project directory anywhere in your system,here i created in my D drive with name my_project
then move current directory to project directory in CMD
Install virtual environment using pip
D:\my_project>pip install virtualenv
Create a virtual environment with name env_mysite you can rename anything as per your reference
env_mysitePS D:\my_project>pip install "django>=2.1,<2.2"
Open http://127.0.0.1:8000/ in any browsers
Congratulation you installed Python django framework
As we know Cookie is often used for identifying user data, when user opening a website, cookie stores information about the user in the browser, Each time the same system requests a page with in a same browser, it will send the cookie too.So when we are considering about the security it is a programmer duty to make it more secure when it exchanging between browser and server,nowadays it is easy to access other website cookie and get the flow of the website using that cookie information.So here am going explain you how to make a cookie secure and httponly in PHP .we have lot of method to accomplish this task,lets have a look on it.
Make cookie secure using PHP.ini
if you have the permission to access php.ini you can open and add below code at the end of php.ini to make your cookie secure and httponly
if you don't have the permission to access php.ini file,fortunately we have another method to accomplish this, which can be done by one of the most common function ini_set();
Make cookie secure using ini_set() function
add below ini_set() functions in the top of your home page
if you don't have the permission to access php.ini file,fortunately we have another method to accomplish this,which can be done by one of the most common function header() in php
Make cookie secure using header() function
add below header() functions in the top of your home page
header("Set-Cookie: key=value; path=/; domain=www.tutorialshore.com; HttpOnly; Secure; SameSite=Strict");
See how we can check a cookie is secure and httponly, we can do with the help of chrome browser as we know almost every browser have the inspect element option, within inspect element tab we have the application section to check cookie see below image.
Click F12 function button go for application => cookies