forked from Rax-io-CI-CD/OpenStackProject
-
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) · 592 Bytes
/
app.py
File metadata and controls
27 lines (18 loc) · 592 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():
params = {'title': 'Upstream, OpenStack Project',
'font_color': 'Red'}
return params
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': int(os.environ.get('PORT', '5000'))})
cherrypy.quickstart(Root())