pip install from requirements.txt

First, make sure you have Django installed on your system. If not, you can install it by running the command pip install django.

Next, create a file called requirements.txt in your project directory.

Inside the requirements.txt file, list all the dependencies and their versions that your Django project requires. For example:

Django==3.2.8
psycopg2==2.9.1

Save the requirements.txt file.

Then, open your command prompt or terminal and navigate to your project directory.

Run the command pip install -r requirements.txt. This command tells pip to install all the dependencies listed in the requirements.txt file.

Pip will start downloading and installing the required packages. It will also ensure that the specified versions are installed.

Once the installation is complete, you can use the installed packages in your Django project.

That's it! You have successfully installed the required packages for your Django project using the requirements.txt file.