Forums

.env without virtualenv

Is the answer to above simple "NO"? If so it means I need to hard code i.e. mysql connection details in the app.py? If so, is that mean I can't use GitHub as the credentials will be visible on GitHub? The reason is, when I used virtualenv, there was no way to get the mysql working as any module I tried didn't worked... So I switched to the default pythonanywhere and voila everything started to work apart from .env... Cheers

You can install python-dotenv using the --user flag: https://help.pythonanywhere.com/pages/InstallingNewModules/

Wow, I can't believe such an easy solution is not mentioned anywhere else (ie everyone "forcing" me to use virtualenv)! THANKS A LOT!

PS. There are, of course, issues with dotenv, so I need to use a workaround of manually reading the .env file (no idea how this will affect security). But this is a small hobbyist project traconis.pythonanywhere.com :)