Multiple Requirements File for each environment in one project, such as local development environment, development code combination environment, commercial environment, etc. I think there are cases where you want to use -file-format). In such a case, let's divide the file.
… Make a note of what you learned.
Create a directory to store the requirements files for each environment.
cd /project/root/directory
mkdir requirements
Let's put the requirements.txt that we used so far as a common file.
mv requirements.txt requirements/common.txt
Examples of files for commercial environments. Create a requirements / prod.txt
file with an editor such as vi. Import common.txt
with the -r
option.
requirements/prod.txt
# requirements for production
-r common.txt
#Below this is a list of packages dedicated to commercial environments
If you are in a development environment, you can create a file such as dev.txt
.
requirements/dev.txt
# requirements for development
-r common.txt
#Below this is a list of packages that are only used in the development environment
Create an alias requirements.txt
for platforms that directly reference requirements.txt
such as heroku.
requirements.txt
# Mirrors prod
-r requirements/prod.txt
.
├── requirements.txt
└── requirements
├── common.txt
├── dev.txt
└── prod.txt