问题描述
我正在学习使用 django 构建简单网站的教程。我正处于准备部署网站的阶段。但是,当我尝试输入
export READ_DOT_ENV_FILE=True
进入终端,我收到错误信息:
export : The term 'export' is not recognized as the name of a cmdlet,function,script file,or operable program. Check the spelling of the name,or if a path was
included,verify that the path is correct and try again.
At line:1 char:1
+ export READ_DOT_ENV_FILE=True
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [],CommandNotFoundE
xception
+ FullyQualifiedErrorId : CommandNotFoundException
我是windows用户,教程人是mac用户。我不知道为什么我会收到这个错误,我希望你们能帮我导出这段代码。以下是我的设置文件中的一些代码供您参考:
READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE',default=False)
if READ_DOT_ENV_FILE:
environ.Env.read_env()
非常感谢!
解决方法
在 Windows 上你应该运行:
setx export READ_DOT_ENV_FILE=True