[Django]-Where do I set environment variables on my Django Digital Ocean server?

9👍

You can create environmental variables inside your .bashrc file in your home folder.
Just open the .bashrc file from home folder

sudo vi ~/.bashrc

And then at the end of the file, add your variable

export SECRET_KEY='your secret key'

then save it, and try running source command on the file so as to enable the variable(So that it gets applied without restarting the system)

source ~/.bashrc

Leave a comment