I'm trying to set some environment variables on the DigitalOcean droplet for my python project.
I put them to the ~/.profile
file. Now it looks like this:
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
PRODUCTION=1
After droplet reset, I tried to get the PRODUCTION
in python
script but it returns None.
>>> import os
>>> os.getenv('PRODUCTION')
>>>
What I'm doing wrong? If not .profile
, what file should I use to permanently set such variables?