I am using a virtual machine on Google Cloud with Ubuntu as the operating system, and I have deployed a Django backend on it. In my settings.py
, I use environment variables like this:
EMAIL_HOST_USER = env('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
I would like to know how to properly set environment variables on the VM so that my Django application can access them. Specifically:
- How do I create environment variables on the VM (Ubuntu)?
- How can I ensure that sensitive data (like EMAIL_HOST_PASSWORD) is not exposed in plain text, but still accessible by my Django app?
Any best practices for securely managing these environment variables in a Google Cloud VM would be appreciated. Thanks!
You need to sign in to view this answers
Leave feedback about this