#settings.py EMAIL_PASS = "FOO" # in any file from django.conf import settings email_password = settings.EMAIL_PASS #to access that variable.
Here is what the above code is Doing:
1. We’re creating a variable called EMAIL_PASS in our settings.py file.
2. We’re importing the settings file into any file that needs to access the EMAIL_PASS variable.
3. We’re creating a new variable called email_password that is equal to the EMAIL_PASS variable in our settings file.
Now, we can use the email_password variable in any file that needs to access the password.