- Install Python: Django is a Python web framework, so you need to have Python installed on your system before you can install Django. You can download and install the latest version of Python from the official Python website.
- Create a virtual environment: It’s a good practice to create a virtual environment before installing any Python packages. This will isolate your project dependencies and avoid conflicts with other Python projects on your system. To create a virtual environment, run the following command in your terminal:
bashCopy codepython -m venv env
This will create a new virtual environment named “env” in your current directory.
- Activate the virtual environment: To activate the virtual environment, run the following command:
bashCopy codesource env/bin/activate
This will activate the virtual environment and you should see the virtual environment name “(env)” in your terminal prompt.
- Install Django: Once your virtual environment is activated, you can install Django using pip, the Python package manager. Run the following command:
Copy codepip install django
This will download and install the latest version of Django in your virtual environment.
- Verify the installation: After installing Django, you can verify the installation by running the following command:
cssCopy codepython -m django --version
This will display the installed version of Django in your terminal.
Congratulations! You have successfully installed Django on your system. Now you can start building your Django project by creating a new project using the django-admin startproject
command.
Install Django Latest Version form here..