File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010csrf = CSRFProtect (app )
1111
1212# Loading config.development and environment variables from .env file.
13+ if 'WEBSITE_HOSTNAME' not in os .environ :
14+ # local development, where we'll use environment variables
15+ print ("Loading config.development and environment variables from .env file." )
16+ app .config .from_object ('azureproject.development' )
17+ else :
18+ # production
19+ print ("Loading config.production." )
20+ app .config .from_object ('azureproject.production' )
21+
1322app .config .update (
14- SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{dbuser}:{dbpass}@{dbhost}/{dbname}' .format (
15- dbuser = os .environ ['DBUSER' ],
16- dbpass = os .environ ['DBPASS' ],
17- dbhost = os .environ ['DBHOST' ],
18- dbname = os .environ ['DBNAME' ]
19- ),
20- SQLALCHEMY_TRACK_MODIFICATIONS = False ,
23+ SQLALCHEMY_DATABASE_URI = app .config .get ('DATABASE_URI' ),
24+ SQLALCHEMY_TRACK_MODIFICATIONS = False ,
2125)
2226
2327# Initialize the database connection
You can’t perform that action at this time.
0 commit comments