How to set DATABASE_URL environment variable for Postgres Mac terminal?
问题 I am using postgres on Mac. I have a database up and running. I want to use it with Flask (SQL Alchemy) but the DATABASE_URL environment variable didn't create itself (I think it's supposed to do that). Here is the code I tried running: import os print(os.getenv("DATABASE_URL")) And there's no output. How can I set the variable (if I need to set it up manually). 回答1: Yes, you have to do that manually. So, within your terminal do this: % cd % nano .bash_profile It will open a file 'bash