# -*- coding: utf-8 -*-
import os

import flask
import redis
import os

app = flask.Flask(__name__)
app.config['DEBUG'] = False


@app.route('/')
def index():

    redis_master_host = os.getenv('REDIS_MASTER_PORT_6379_TCP_ADDR')
    redis_master_port = os.getenv('REDIS_MASTER_PORT_6379_TCP_PORT')

    redis_slave_host = os.getenv('REDIS_SLAVE_PORT_6379_TCP_ADDR')
    redis_slave_port = os.getenv('REDIS_SLAVE_PORT_6379_TCP_PORT')

    r_master = redis.StrictRedis(host=redis_master_host, port=redis_master_port, db=0)

    counter_master = r_master.incr('counter')

    # connect to slave only if slave was configured
    if redis_slave_host and redis_slave_port:
        r_slave = redis.StrictRedis(host=redis_slave_host, port=redis_slave_port, db=0)
        counter_slave = r.get('counter')
    else:
        counter_slave = None


    return flask.render_template('index.html', counter_master=counter_master,counter_slave=counter_slave)

@@ -506,22 +506,16 @@
 ter_port
-, db=0
 )%0A%0A    c
@@ -738,14 +738,8 @@
 port
-, db=0
 )%0A  
@@ -761,16 +761,22 @@
 lave = r
+_slave
 .get('co
@@ -874,39 +874,106 @@
 ml',
- counter_master=counter_master,
+%0A                                 counter_master=counter_master,%0A                                 
 coun

fix it