I have a ubuntu server deployed at digitalocean with gunicorn and nginx to host my django project.
Now I want to save my secret key in an env. var. . I searched in the internet and I found that I have to modify a file called .bash_profile
but I don't have this file in my home directory.
What should I do?
Thx for your help and stay healthy!
Create the file with a text editor of your choice.
~/.bash_profile
would however not be an ideal location for this, because it's only read by bash. There are better places to set the environment variables.~/.profile
Is read by other shells as well, but those files are only read when the shell is called as a login shell. When you run an application as a service this is usually not the case.Ideally you would configure an environment file in your service definition if your service is run by systemd, or set it in the startup script of your service if you are using another init system.