We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5643ad8 commit e9ed899Copy full SHA for e9ed899
azure-vote/azure-vote/main.py
@@ -7,11 +7,23 @@
7
8
app = Flask(__name__)
9
10
-# Load configurations
+# Load configurations from environment or configu file
11
app.config.from_pyfile('config_file.cfg')
12
-button1 = app.config['VOTE1VALUE']
13
-button2 = app.config['VOTE2VALUE']
14
-title = app.config['TITLE']
+
+if "VOTE1VALUE" in os.environ:
+ button1 = os.environ['VOTE1VALUE']
15
+else:
16
+ button1 = app.config['VOTE1VALUE']
17
18
+if "VOTE2VALUE" in os.environ:
19
+ button2 = os.environ['VOTE2VALUE']
20
21
+ button2 = app.config['VOTE2VALUE']
22
23
+if "TITLE" in os.environ:
24
+ title = os.environ['TITLE']
25
26
+ title = app.config['TITLE']
27
28
# Redis configurations
29
redis_server = os.environ['REDIS']
0 commit comments