requirement.txt

  1. Open a terminal/command prompt and navigate to your Django project directory.

  2. Activate your virtual environment (if you are using one).

  3. Use the pip freeze command to generate a list of all installed packages and their versions:

pip freeze > requirements.txt

This command will save the output of pip freeze to a file named requirements.txt.

Your requirements.txt file is now ready and should contain a list of all packages installed in your virtual environment along with their version numbers.

Note that it's a good practice to regularly update your requirements.txt file to include any new packages or updates to existing packages that you may have installed in your project.

Last updated