I recently created a flask app and uploaded it successfully to a webapp directory created on Webfaction. I stored credentials into environment variables in my apache's bin/start script. After inserting configuration code (down below) into my former basic flask app, which contained nothing more than a route to '/' and a message that said "Hello world", I immediately got a 500 internal server error. What am I doing wrong here? And how do I fix this? init.py
start
error logs (simplified to show details)
asked 01 Dec '15, 20:39 Guled |
Just found my mistake! All I had to do was add the environment variables to my .bash_profile.
Also, I was using os.environ incorrectly. I needed to use the get function like so:
EDIT: I recommend to store your environment variables in your answered 01 Dec '15, 21:45 Guled |