Forums

Secure place to store .env file

I have recently followed this guide to set up environment variables in an .env file.

I chose to place the file at /~/.env. Is that a secure and recommended place to put the file? The guide mentions the "project folder" as a place to store it but I am not entirely sure what folder that is.

You can find it under "Working Directory" on the "Web" page

So it is more secure to store it in ~/my-project/ than in ~/ ? The latter seems more unreachable to me but maybe there's no difference?

There is no security consideration, but it is rather for tidiness.

Is it safe to store my secrets in .env in PythonAnywhere? How secure is the platforrm?

We have details on security and PythonAnywhere on this help page.