Created
December 10, 2014 12:36
-
-
Save mjul/54c7c9e936588e713537 to your computer and use it in GitHub Desktop.
Configure a Python Flask application to use the associated Amazon RDS Postgres (or MySQL) database when running on Elastic Beanstalk (inside Docker).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver = 'mysql+pymysql://' | |
driver = 'postgresql+psycopg2://' | |
app.config['SQLALCHEMY_DATABASE_URI'] = driver \ | |
+ os.environ['RDS_USERNAME'] + ':' + os.environ['RDS_PASSWORD'] \ | |
+'@' + os.environ['RDS_HOSTNAME'] + ':' + os.environ['RDS_PORT'] \ | |
+ '/' + os.environ['RDS_DB_NAME'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment