KeyError Accessing Secret Stored in Railway
isaacv
TRIALOP

2 years ago

I am trying to access my database password stored as a variable on Railway. In my Django app I have code that looks like db_pw = os.environ['DB_PW'] in my settings.py file where DB_PW is a variable name I've added to my Railway project. When I try to deploy the project, the deployment crashes, and the Deploy Log says: KeyError: 'DB_PW' right before the line: container event container died.

Using Python 3.12.4. Deployment using files on a github repository.

I'm a newbie to Railway. Thank you.

3 Replies

2 years ago

You have not yet applied the change -


isaacv
TRIALOP

2 years ago

Thank you. Moving onto the next problem, which I hope is as easy to resolve! Seems to have to do with my proc file. Getting a ModuleNotFoundError


2 years ago

Do you have all the needed packages in your requirements.txt file?


Loading...