Skip to content

Commit e45243f

Browse files
authored
Update Dashblock_API to settings.toml
1 parent 76cd05b commit e45243f

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

PyPortal/Dashblock_API/code.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@
88
then display the number of learn guides on the site
99
"""
1010

11+
import os
1112
import time
1213
import board
1314
from adafruit_pyportal import PyPortal
1415

15-
# Get wifi details and more from a secrets.py file
16-
try:
17-
from secrets import secrets
18-
except ImportError:
19-
print("WiFi settings are kept in settings.py, please add them there!")
20-
raise
21-
2216
# Set up where we'll be fetching data from
23-
DATA_SOURCE = "https://api.dashblock.io/model/v1?api_key=" + secrets['dashblock_key']
17+
DATA_SOURCE = "https://api.dashblock.io/model/v1?api_key=" + os.getenv("DASHBLOCK_KEY")
2418
GUIDE_COUNT = ['entities', 0, 'guide count']
2519
CAPTION = 'total tutorials:'
2620

0 commit comments

Comments
 (0)