How to hide stuff in repl.it
I'm trying to hide my database url and .env files are not working for me at all... How would I hide my db url?
If you're not an explorer, you have to create a file called
.env and then you can put stuff inside. If you're an explorer, they sadly took that feature off and made it into a GUI, you can find it here (the lock icon):
It'll tell you how to access those variables.
What’s the error? Can you send a screenshot please? Also what was the code; did you simply output one of the variables in the
.env? In that case, I don’t think any other user than you can view it as only the owner of a repl (and anyone who has edit access in a multiplayer repl) can have access to that bc variable.
@Bookie0 I fixed the problem of it creating a db for every person but I want to hide my api key for my db so nobody else can access it. (P.S. Thanks for actually staying on my question and not giving up. For that (and probably because there is no solution) I'm marking your answer as correct (Even though it didn't really help :))
Try renaming the
.env variable to dburl (idk if the underscore bugs it out or not), then try
os.getenv("dburl") instead. (It returns
None if no variable is set.) Plus, the Repl Env tab is buggy, so that may be your issue.
we now use the lock icon, please refer to the docs: