Secrets such as connection strings, passwords, etc. can be stored in Valohai as environment variables. You can define them under your Project Settings and set them as Secret so they're not visible in the user interface.
In your code you'd then access them like any other environment variable. For example
password = os.getenv('password')