Heroku 在pip要求文件中使用环境变量

Heroku 在pip要求文件中使用环境变量,heroku,pip,Heroku,Pip,我已将以下内容添加到我的requirements.txt文件中,以便在Heroku应用程序中使用: git+https://username:my_real_password@bitbucket.org/user/repo.git 但是,我不想在我的repo中使用密码,所以我想在Heroku中创建一个名为password的环境变量,并将其设置为'my_real_password' 然后,我将需求文件中的行更改为: git+https://username:$PASSWORD@bitbucket

我已将以下内容添加到我的requirements.txt文件中,以便在Heroku应用程序中使用:

git+https://username:my_real_password@bitbucket.org/user/repo.git
但是,我不想在我的repo中使用密码,所以我想在Heroku中创建一个名为password的环境变量,并将其设置为'my_real_password'

然后,我将需求文件中的行更改为:

git+https://username:$PASSWORD@bitbucket.org/user/repo.git
但pip将我的密码解释为$password


所以我的问题是,如何强制pip查找环境变量?我可以使用转义字符吗?

您不想使用git+ssh并使用ssh密钥进行身份验证的原因是什么?这是我最初想要做的,但我不知道如何在heroku上创建ssh密钥。“heroku key”命令用于将我的公钥添加到heroku。如果我理解正确,我需要做的是在heroku中创建一个私钥和公钥,用于从bitbucket获取包。你知道怎么设置吗?