aboutsummaryrefslogtreecommitdiffstats
path: root/templating/templating.py
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-11-07 20:15:26 +0100
committerKristian Lyngstol <kly@kly.no>2016-11-07 20:15:26 +0100
commit1645bca3aed66c2121fe6d8aaeea8405906723e2 (patch)
treeb4c00cde77a2bbc8255d1b295b962b14926889ac /templating/templating.py
parentfc1b028e555a3703fbc643965620dea919f3fe19 (diff)
Scaffolding for functional templating :D
Diffstat (limited to 'templating/templating.py')
-rwxr-xr-xtemplating/templating.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/templating/templating.py b/templating/templating.py
index 47c886d..2c1259a 100755
--- a/templating/templating.py
+++ b/templating/templating.py
@@ -8,7 +8,7 @@ endpoints = "read/oplog read/snmp read/switches-management public/config public/
objects = dict()
def getEndpoint(endpoint):
- r = requests.get("http://localhost/api/%s" % endpoint, auth=('demo','demo'))
+ r = requests.get("http://gondul-front:/api/%s" % endpoint, auth=('demo','demo'))
if (r.status_code != 200):
raise Exception("Bad status code for endpoint %s: %s" % (endpoint, r.status_code))
return r.json()
@@ -17,7 +17,7 @@ def updateData():
for a in endpoints:
objects[a] = getEndpoint(a)
-env = Environment(loader=FileSystemLoader('templates/'))
+env = Environment(loader=FileSystemLoader(['templates/','/opt/gondul/templating/templates']))
import http.server
class MyHandler(http.server.BaseHTTPRequestHandler):
@@ -38,7 +38,7 @@ class MyHandler(http.server.BaseHTTPRequestHandler):
self.wfile.flush()
def run(server_class=http.server.HTTPServer, handler_class=http.server.BaseHTTPRequestHandler):
- server_address = ('', 8000)
+ server_address = ('', 8080)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()