Installation
For Windows
Install Python
Django is a Python web framework, thus requiring Python to be installed on your machine.
To install Python on your machine , follow the link https://python.org/download/, and download a Windows MSI installer for Python. Once downloaded, run the MSI installer and follow the on-screen instructions.
Once the installation is complete, open the command prompt and check the Python version by executing this command
You can check it in your terminal window using these commands.
python --version
Install Django
Now we have everything we need to install in Django. We can easily install Django by running this command in the command prompt.
You can check it in your terminal window using these commands.
pip install Django
Installing packages
-
Navigate to the root main/directory,default
-
if you want to create env then here is command for create environment.
py -m venv envcommand (for create env) -
Then use
py -m venv env / env\Scripts\activatecommand (for activate env) -
Then use
py -m pip install -r requirements.txtcommand (install requirement.txt file) -
Python/Python3 manage.py runservercommand (for run project) -
Click on this link with press ctrl button
http://127.0.0.1:8000/command (for start project)
For Linux
Updating System
Update your system by executing the below given command in your terminal.
You can check it in your terminal window using these commands.
sudo apt-get update
Install Python
Although you already have python installed in your system, as it is included while installing any linux based os, but if it is not included run the following command to install python.
You can check it in your terminal window using these commands.
sudo apt-get install python3
Check the version of python through this command.
python3 --version
Install pip
Pip is included with the python versions above 3.4. So if you have installed python version which is above 3.4 then you can skip this step
Run this command in the terminal to install pip.
sudo apt-get install python3-pip
Install Django
Now we are all set to install Django in our system. Run this command in the terminal.
pip install Django.
Installing packages
-
Navigate to the root main/directory,default
-
if you want to create env then here is command for create environment.
python3 -m venv envcommand (for create env) -
Then use
source env/bin/activatecommand (for activate env) -
Then use
pip/pip3 install -r requirements.txtcommand (install requirement.txt file) -
python/python3 manage.py runservercommand (for run project) -
Click on this link with press ctrl button
http://127.0.0.1:8000/command (for start project)