· 7 years ago · Mar 10, 2018, 07:14 PM
1# edit the URI below to add your RDS password and your AWS URL
2# The other elements are the same as used in the tutorial
3# format: (user):(password)@(db_identifier).amazonaws.com:3306/(db_name)
4import os
5#SQLALCHEMY_DATABASE_URI = os.environ['SQLALCHEMY_DATABASE_URI']
6
7# Load config from the AWS Elastic Beanstalk Environemnt Variables for RDS
8# NOTE: all the RDS env variables are automatically set by Beanstalk when
9# an RDS database is added.
10SQLALCHEMY_DATABASE_URI = "mysql+pymysql://%s:%s@%s/%s" % (
11 os.environ['RDS_USERNAME'],
12 os.environ['RDS_PASSWORD'],
13 os.environ['RDS_HOSTNAME'],
14 os.environ['RDS_DB_NAME'])
15
16# Uncomment the line below if you want to work with a local DB
17#SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
18
19SQLALCHEMY_POOL_RECYCLE = 3600
20
21WTF_CSRF_ENABLED = True
22SECRET_KEY = os.environ['SECRET_KEY']