help_pages icon indicating copy to clipboard operation
help_pages copied to clipboard

Environment Variables help page does not address non virtualenv bash consoles

Open aadibajpai opened this issue 5 years ago • 2 comments

https://github.com/pythonanywhere/help_pages/blob/master/articles/EnvironmentVariables.md

mentions how to load environment variables in your web application or in your virtualenv consoles.

However, not everyone uses a virtualenv and there is no documentation to address loading the environment variables into a normal bash console.

I discovered you just need to add set -a; source ~/my-project-dir/.env; set +a to the .bashrc file that's at /home/username/ so it shouldn't be hard.

I think this would make the article more complete, I could open a PR if you want but I wanted to run this past you guys first :)

aadibajpai avatar Jun 15 '19 21:06 aadibajpai

Hmm, interesting point! We'd need to warn people not to do that if they have multiple websites, though, as that could lead to confusion -- I was helping someone out on tech support the other day who was getting really weird behaviour in bash with a Django site, and it turned out that they were setting stuff in their .bashrc that was related to one of their websites, which then broke stuff when they were working on another one.

gpjt avatar Jun 17 '19 14:06 gpjt

@gpjt makes sense, however since the free version has just one website and that's probably what the most people are at, this becomes something worth mentioning. Not sure if there's a major use case making a virtualenv for one website.

aadibajpai avatar Jun 17 '19 20:06 aadibajpai