Installing Django

Installing Django is very easy. Make sure you have created and activated a virtual environment. Installing Django inside a virtual environment keeps project dependencies isolated and prevents conflicts with other Python projects. Do not install Django globally.

Install Django

Run the following command in your terminal:

pip install django

This command downloads and installs the latest stable version of Django along with its required dependencies.

Verify the Installation

After installation, check the installed Django version:

django-admin --version
#6.0.6

If Django is installed correctly, the command will display the version number.

View Installed Packages

You can see all packages installed in the current virtual environment using:

pip list

Install a Specific Django Version

If your project requires a particular version of Django, specify it during installation:

pip install django==6.0.6