summaryrefslogtreecommitdiff
path: root/sbhs_server
diff options
context:
space:
mode:
Diffstat (limited to 'sbhs_server')
-rw-r--r--sbhs_server/credentials.py.example3
-rw-r--r--sbhs_server/settings.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/sbhs_server/credentials.py.example b/sbhs_server/credentials.py.example
index 9f6ec5f..255bbae 100644
--- a/sbhs_server/credentials.py.example
+++ b/sbhs_server/credentials.py.example
@@ -2,4 +2,5 @@ PROJECT_SECRET_KEY = 'your django project secret key'
EMAIL_HOST_USER = 'username'
EMAIL_HOST_PASSWORD = 'password'
MAP_FILE = 'path/to/file/map_machine_ids.txt'
-LOG_FILE = '/path/to/logfile' \ No newline at end of file
+LOG_FILE = '/path/to/logfile'
+ADMIN_EMAIL='admin email' \ No newline at end of file
diff --git a/sbhs_server/settings.py b/sbhs_server/settings.py
index b7ec8b7..15dc8ae 100644
--- a/sbhs_server/settings.py
+++ b/sbhs_server/settings.py
@@ -136,6 +136,7 @@ EMAIL_HOST = 'smtp.gmail.com' #'smtp-auth.iitb.ac.in'
EMAIL_PORT = 587 #25
EMAIL_HOST_USER = credentials.EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = credentials.EMAIL_HOST_PASSWORD
+ADMIN_EMAIL=credentials.ADMIN_EMAIL
# Static files (CSS, JavaScript, Images)
@@ -251,13 +252,13 @@ with open(os.path.join(BASE_DIR, 'map_machine_ids.txt')) as f:
for line in f:
try:
data = line.split("=")
- MID_PORT_MAP[int(data[0])]=data[1].strip()
brd = sbhs.Sbhs()
b = brd.connect(int(data[0]))
assert b == True
- key = int(brd.getMachineId())
+ key = int(brd.getMachineId())
assert key > 0
brd.reset_board()
+ MID_PORT_MAP[key]=data[1].strip()
boards[str(key)] = {"board": brd, "experiment_id": None}
except:
pass