导出等效于 Windows?

问题描述

我正在学习使用 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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...