File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 77
88app = Flask (__name__ )
99
10- # Load configurations
10+ # Load configurations from environment or config file
1111app .config .from_pyfile ('config_file.cfg' )
12- button1 = app .config ['VOTE1VALUE' ]
13- button2 = app .config ['VOTE2VALUE' ]
14- title = app .config ['TITLE' ]
12+
13+ if ("VOTE1VALUE" in os .environ and os .environ ['VOTE1VALUE' ]):
14+ button1 = os .environ ['VOTE1VALUE' ]
15+ else :
16+ button1 = app .config ['VOTE1VALUE' ]
17+
18+ if ("VOTE2VALUE" in os .environ and os .environ ['VOTE2VALUE' ]):
19+ button2 = os .environ ['VOTE2VALUE' ]
20+ else :
21+ button2 = app .config ['VOTE2VALUE' ]
22+
23+ if ("TITLE" in os .environ and os .environ ['TITLE' ]):
24+ title = os .environ ['TITLE' ]
25+ else :
26+ title = app .config ['TITLE' ]
1527
1628# Redis configurations
1729redis_server = os .environ ['REDIS' ]
You can’t perform that action at this time.
0 commit comments