The cart is empty

Installing Django, a popular web framework written in Python, is the first step towards building dynamic web applications. In this article, we'll explore how to install Django on various operating systems: Windows, Linux, and Mac. Follow the steps below for your specific operating system.

Prerequisites

Before you begin, ensure you have Python installed. Django requires Python version 3.6 or newer. You can verify your Python version on your system by running python --version (or python3 --version) in the command prompt or terminal.

Installation on Windows

  1. Open Command Prompt: Press Win + R, type cmd, and press Enter.
  2. Install Django: Run the following command to install Django using pip, the package manager for Python: python -m pip install django.

Installation on Linux

  1. Open Terminal: You can find it in your distribution's application menu or by pressing Ctrl + Alt + T.
  2. Install Django: Use pip to install Django with the command: python3 -m pip install django. In some Linux distributions, you may need to install pip before installation using your distribution's package manager, such as sudo apt install python3-pip on Debian or Ubuntu.

Installation on Mac

  1. Open Terminal: Find it in Launchpad or use Spotlight search.
  2. Install Django: Similar to Linux, use pip to install Django by running python3 -m pip install django in Terminal.

Verification of Installation

After installing Django, you can verify that the installation was successful by running django-admin --version in the command prompt or terminal. It should display the version of Django you just installed.

Next Steps

After successfully installing Django, you can start creating your first project. Running django-admin startproject myproject will create a new Django project named "myproject". You can then navigate to the project folder and start the development server using python manage.py runserver. Open a browser and go to http://127.0.0.1:8000/ to view the Django welcome page.

Congratulations, you now have Django installed and are ready to begin building web applications!