how to generate requirements.txt django

For Unix families: pip3 freeze > requirements.txt
For Windos: pip freeze > requirements.txt

Here is what the above code is Doing:
1. It’s creating a requirements.txt file in the current directory.
2. It’s running the pip3 freeze command, which outputs a list of all the Python packages installed in the current virtual environment, and writes the output to the requirements.txt file.
3. It’s running the pip freeze command, which outputs a list of all the Python packages installed in the current virtual environment, and writes the output to the requirements.txt file.

The requirements.txt file will look something like this:

Flask==0.12.2
Jinja2==2.10
MarkupSafe==1.0
Werkzeug==0.14.1
click==6.7
ItsDangerous==0.24
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2

You can then use this file to install all the necessary packages on another machine:

pip install -r requirements.txt