Deploy Django - Create requirements.txt

When you create a Django application, there are some Python packages that your project depends on.

Django itself is a Python package, and we have to make sure that the server where we deploy our project also has the Django package installed, and all the other packages your project requires.

Luckily there is a command for this as well, just run this command in the command view:


pip freeze > requirements.txt 


Now navigate to the "/my_blog" folder and open the requirements.txt file, you would see something like



asgiref==3.5.2
Django==4.1.4
psycopg2-binary==2.9.5
sqlparse==0.4.3
tzdata==2022.7
whitenoise==6.2.0


To install from requirements.txt, type the following command in your shell


pip install -r requirements.txt


Latest Blog