我正在尝试在Heroku上为Django的密钥设置环境变量,需要使用Powershell。
我收到了以下错误信息(因为字符串中有3个&符号,所以出现了3次):
当我尝试了建议的解决方案(在和号周围加上双引号)时:
(venv) PS WORKFOLDER> heroku config:set SECRET_KEY=eoik6-&dnr9elgmrt7-%3hu_&37$3hg!9c6x!^khjr3!z*z&b4
我收到了以下错误信息(因为字符串中有3个&符号,所以出现了3次):
At line:1 char:77
+ heroku config:set SECRET_KEY=eoik6-&dnr9elgmrt7-%3hu_&37$3hg!9c6x!^khjr3!z*z&b4
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed
当我尝试了建议的解决方案(在和号周围加上双引号)时:
(venv) PS WORKFOLDER> heroku config:set SECRET_KEY=eoik6-"&"dnr9elgmrt7-%3hu_"&"37$3hg!9c6x!^khjr3!z*z"&"b4
I got this error:
SECRET_KEY: eoik6-
'dnr9elgmrt7-%3hu_' is not recognized as an internal or external command, operable program or batch file.
'37$3hg!9c6x!^khjr3!z*z' is not recognized as an internal or external command, operable program or batch file.
'b4' is not recognized as an internal or external command, operable program or batch file.
我也尝试使用斜杠进行转义,将整个字符串放在引号中等等。结果相同。那么我该如何设置我的环境变量?