summaryrefslogtreecommitdiff
path: root/sbhs_server/settings.py
diff options
context:
space:
mode:
authordk-152017-05-22 16:28:20 +0530
committerdk-152017-05-22 16:29:48 +0530
commit187752f92a1aaed0408a20e8e40b9d1b82b69847 (patch)
tree1d8e283a2776bb8cebc37cd9297f717f6f9cb066 /sbhs_server/settings.py
parentd2db202479579f85b0947836d412902bf3e6b0ee (diff)
downloadSBHS-2018-Rpi-187752f92a1aaed0408a20e8e40b9d1b82b69847.tar.gz
SBHS-2018-Rpi-187752f92a1aaed0408a20e8e40b9d1b82b69847.tar.bz2
SBHS-2018-Rpi-187752f92a1aaed0408a20e8e40b9d1b82b69847.zip
Write views for admin/testing
Diffstat (limited to 'sbhs_server/settings.py')
-rw-r--r--sbhs_server/settings.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbhs_server/settings.py b/sbhs_server/settings.py
index ca3d133..b7ec8b7 100644
--- a/sbhs_server/settings.py
+++ b/sbhs_server/settings.py
@@ -10,6 +10,9 @@ 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"
@@ -32,6 +35,8 @@ TEMPLATE_DEBUG = not is_production
ALLOWED_HOSTS = [
"localhost",
"127.0.0.1",
+ "192.168.43.208",
+ "192.168.43.144",
]
if not DEBUG:
@@ -57,6 +62,7 @@ INSTALLED_APPS = (
'undelete',
#'yaksh',
'taggit',
+ #'corsheaders'
'account',
'myadmin',
@@ -68,19 +74,21 @@ INSTALLED_APPS = (
'webcam',
)
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ #'corsheaders.middleware.CorsMiddleware',
)
ROOT_URLCONF = 'sbhs_server.urls'
WSGI_APPLICATION = 'sbhs_server.wsgi.application'
+#CORS_ORIGIN_ALLOW_ALL=True
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
@@ -238,10 +246,12 @@ SBHS_GLOBAL_LOG_DIR = os.path.join(BASE_DIR, 'log')
from sbhs_server import sbhs
boards = {}
+MID_PORT_MAP={}
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