forked from rackspace-solum-samples/solum-python-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (18 loc) · 645 Bytes
/
Copy pathapp.py
File metadata and controls
27 lines (18 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import cherrypy
from jinja2 import Environment, FileSystemLoader
ENV = Environment(loader=FileSystemLoader('templates'))
def get_params():
params1 = {'key': os.environ.get('key', ''),
'user': os.environ.get('user', ''),
'password': os.environ.get('password', '')}
return params1
class Root(object):
@cherrypy.expose
def index(self):
tmpl = ENV.get_template('index.html')
params = get_params()
return tmpl.render(params)
cherrypy.config.update({'server.socket_host': '0.0.0.0',
'server.socket_port': 80})
cherrypy.quickstart(Root())