01 - download installed django
in this blog we see how to download how to download the django in the device
before start
install python
we are going to installed Django in virtual environment not in main machine or host machine .
first to create virtual environment
python3 -m venv .venv
# for windows
# python -m venv .venv
# to activate the virtual environment
source .venv/bin/activate
# for windows
# .venv\Scripts\activate
second way and i use this -
- we create virtual environment in python
venv
here we useuv
becauseuv
An extremely fast Python package installer and resolver i installeduv
on local machine (currently).
# you this cmd in both os system (macOs and window)
pip install uv
# to create a virtual environment
uv venv
# activation commands are same as above
# On macOS and Linux.
source .venv/bin/activate
# On Windows.
.venv\Scripts\activate
then activate virtual environment
download Django with this cmd
uv pip install Django
package list or installed multiple package
# package list
pip list
or
uv pip list
# create package list
pip list > fileName.txt
or
uv pip list > fileName.txt
# good practice is
pip list > requirements.txt
or
uv pip list > requirements.txt
# install multiple package
uv pip install -r fileName.txt
or
pip install -r fileName.txt
create Django project
django-admin startproject <project-name>
.venv
folder or virtual environment folder and your project folder should be in same line Django
create sub folder with same name folder inside the folder project folder with manage.py
run the python server
come to file project folder
python manage.py runserver
# if you get this error (Error: You don't have permission to access that port.) try to change the port
python manage.py runserver <change-port>
this will work if you want to want some specific port and this is not available then read this blog blog