1

I am following a tutorial on building a simple website using django. I am at the stage of preparing my website for deployment. However, when I try to enter

export READ_DOT_ENV_FILE=True

into the terminal, I get the error message:

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

I am a windows user, and the tutorial person is a mac user. I don't know why I am getting this error, and I hope you guys could help me export this code. Here are some codes in my settings file for your reference:

READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
    environ.Env.read_env()

Thanks a lot!

Compo
  • 36,585
  • 5
  • 27
  • 39
coderDcoder
  • 585
  • 3
  • 16
  • Does this answer your question? [Windows equivalent of $export](https://stackoverflow.com/questions/18701783/windows-equivalent-of-export) – drec4s Mar 25 '21 at 16:43
  • Thanks for your comment. But, I also looked at that page before uploading this article, and I didn't get any replacement code for "export READ_DOT_ENV_FILE=True". – coderDcoder Mar 25 '21 at 16:46
  • @JohnSong `SET READ_DOT_ENV_FILE=True`? – Mathias R. Jessen Mar 25 '21 at 17:08
  • Thanks for the comment. I don't think it worked if I use SET instead of export. – coderDcoder Mar 25 '21 at 17:17
  • Windows Subsystem for Linux is the bomb. Using the Windows DOS environment for programming is an exercise in frustration. – Mike Slinn Mar 26 '21 at 02:34
  • So... are you saying that if I use the WSL2, I can just use the export command(as well as other commands available for linux) in the windows terminal? – coderDcoder Mar 26 '21 at 05:08

1 Answers1

0

On windows you should run:

setx export READ_DOT_ENV_FILE=True
Osadhi Virochana
  • 1,294
  • 2
  • 11
  • 21
Sota13
  • 1