Ask coding questions

← Back to all posts
Why I cannot create .env file in my repl?
Indhu18 (0)

I cannot create .env file.

Answered by Bookie0 (6299) [earned 5 cycles]
View Answer
Bookie0 (6299)

You can't make .env files anymore, you'll have to use this new GUI by clicking the lock icon in the sidebar (near where the files are kept). Then you just enter the name of a key and its value. And in the repl, you do import os, and my_secret = os.environ['name of your key here']. Good luck! :)

Indhu18 (0)

Thank you @Bookie0. Now I understand it.

Bookie0 (6299)

@Indhu18 No problem! Glad this helped! :D

Mioun (20)

Now, there is no need to create .env files because replit provides an .env sidebar. press this button