Skip to content

Commit 298ea23

Browse files
authored
Update examples.py
1 parent 5ce7540 commit 298ea23

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

config-management-basics/env-vars/examples.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
print(f"Connecting to {database_host}:{database_port}")
1111

12+
database_port = int(os.environ.get('DATABASE_PORT', '5432'))
13+
max_connections = int(os.environ.get('MAX_CONNECTIONS', '10'))
14+
15+
total_capacity = database_port + max_connections # Now this works with integers
16+
1217
# Set an environment variable
1318
os.environ['APP_ENV'] = 'development'
1419
os.environ['MAX_CONNECTIONS'] = '100'

0 commit comments

Comments
 (0)