diff options
Diffstat (limited to 'sbhs_server')
-rw-r--r-- | sbhs_server/credentials.py.example | 5 | ||||
-rw-r--r-- | sbhs_server/sbhs.py | 9 | ||||
-rw-r--r-- | sbhs_server/settings.py | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/sbhs_server/credentials.py.example b/sbhs_server/credentials.py.example new file mode 100644 index 0000000..9f6ec5f --- /dev/null +++ b/sbhs_server/credentials.py.example @@ -0,0 +1,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 diff --git a/sbhs_server/sbhs.py b/sbhs_server/sbhs.py index 1cb9f52..085de09 100644 --- a/sbhs_server/sbhs.py +++ b/sbhs_server/sbhs.py @@ -1,10 +1,11 @@ import serial import os from time import localtime, strftime, sleep +import sbhs_server.credentials as credentials -MAP_FILE = '/home/vlabs/sbhs_vlabs/sbhs/map_machine_ids.txt' +MAP_FILE = credentials.MAP_FILE #LOG_FILE = '../log/sbhserr.log' -LOG_FILE = '/tmp/sbhserr.log' +LOG_FILE = credentials.LOG_FILE OUTGOING_MACHINE_ID = 252 INCOMING_FAN = 253 @@ -42,11 +43,11 @@ class Sbhs: usb_device_file = False for mapping_str in map_file.readlines(): mapping = mapping_str.split('=') - self.log('mapping: ' + mapping[1], 'ERROR') #srikant + self.log('mapping: ' + mapping[1], 'ERROR') #srikant # if mapping for the machine id found set the usb device file and break out of loop if mapping[0] == str(self.machine_id): usb_device_file = mapping[1].strip() - #self.log('usb_device_file: ' + usb_device_file, 'ERROR') #srikant + #self.log('usb_device_file: ' + usb_device_file, 'ERROR') #srikant break # reached end of file and check if machine id entry is present in the machine map file map_file.close() diff --git a/sbhs_server/settings.py b/sbhs_server/settings.py index b690e83..5c0f973 100644 --- a/sbhs_server/settings.py +++ b/sbhs_server/settings.py @@ -9,6 +9,7 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ """ import sys #srikant import socket +import sbhs_server.credentials as credentials hostname = socket.gethostname() is_production = hostname == "vlabs-Veriton-Series" @@ -21,7 +22,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'k8^&^wr-skvt1bw$7^9mp$ic^5iubco@=bz*@hljl+vz9-&&_p$$$deep' +SECRET_KEY = credentials.PROJECT_SECRET_KEY # SECURITY WARNING: don't run with debug turned on in production! DEBUG = not is_production @@ -122,8 +123,8 @@ SESSION_COOKIE_NAME = "frffvbaVq" EMAIL_HOST = 'smtp-auth.iitb.ac.in' EMAIL_PORT = 25 -EMAIL_HOST_USER = "username" -EMAIL_HOST_PASSWORD = "password" +EMAIL_HOST_USER = credentials.EMAIL_HOST_USER +EMAIL_HOST_PASSWORD = credentials.EMAIL_HOST_PASSWORD # Static files (CSS, JavaScript, Images) @@ -249,7 +250,6 @@ with open(os.path.join(BASE_DIR, 'map_machine_ids.txt')) as f: pass online_mids = [int(i) for i in boards.keys()] - import sys print >>sys.stderr, online_mids[1:33] #srikant #srikant |