005-Django - Install Django

Objectives: -Django - Install Django

Django - Install Django

Install Django

Now that we have created a virtual environment, we are ready to install Django inside it. ⚠️ Important: Make sure your virtual environment is activated before installing.

1. Install Django

Run the following command inside your activated virtual environment:

(myworld) ... $ python -m pip install Django

On a successful install, you’ll see output similar to this:

Collecting Django
  Downloading Django-5.1.7-py3-none-any.whl.metadata (4.1 kB)
Collecting asgiref<4,>=3.8.1 (from Django)
  Downloading asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB)
Collecting sqlparse>=0.3.1 (from Django)
  Downloading sqlparse-0.5.3-py3-none-any.whl.metadata (3.9 kB)
Collecting tzdata (from Django)
  Downloading tzdata-2025.1-py2.py3-none-any.whl.metadata (1.4 kB)
Downloading Django-5.1.7-py3-none-any.whl (8.3 MB)
Installing collected packages: tzdata, sqlparse, asgiref, Django
Successfully installed Django-5.1.7 asgiref-3.8.1 sqlparse-0.5.3 tzdata-2025.1
  

Real-life Example:

Installing Django is like installing Microsoft Word on your laptop. Once it’s installed, you can start creating documents (or in Django’s case, web apps).

2. Windows, Mac, or Linux?

The installation steps are mostly the same. Some Windows systems may prefer py instead of python:

  • Windows: py -m pip install django
  • Mac/Linux: python3 -m pip install django

Advice:

Always use python -m pip instead of just pip. It ensures the correct Python version is used with the correct PIP.

3. Check Django Version

After installation, check if Django is installed correctly:

(myworld) C:\Users\Your Name> django-admin --version

Expected output:

5.1.7

4. Installing Django in 2025 (Best Practice)

As of 2025, the recommended way is still to use PIP inside a virtual environment. But some developers prefer to use:

  • pipx (to install globally but isolated per app)
  • Poetry (for dependency management and project packaging)

For most beginners, stick with:

python -m venv myworld
myworld\Scripts\activate # Windows
python -m pip install django

Real-life Example:

PIP is like downloading apps from Google Play or App Store. Tools like Poetry are more advanced, like using Docker containers — powerful, but not needed for starters.

Advice:

Beginners should focus on learning Django with PIP and venv. Later, when working on bigger projects, you can explore Poetry or Docker.

5. What’s Next?

🎉 Congrats! You now have Django installed. In the next step, you’ll create your first Django project and learn how to use Django’s powerful features.

Reference Book: N/A

Author name: SIR H.A.Mwala Work email: biasharaboraofficials@gmail.com
#MWALA_LEARN Powered by MwalaJS #https://mwalajs.biasharabora.com
#https://educenter.biasharabora.com

:: 1::