Exemplo n.º 1
0
        rc.sadd(key, request.form['value'])
    if 'hash' in key_type:
        rc.hset(key, request.form['field'], request.form['value'])
    if 'string' in key_type:
        rc.set(key, request.form['value'])


# should be renamed as get redis client
def _get_host_and_port(request):
    env = request.cookies.get('currentEnvironment')
    host = 'localhost'
    port = 6379
    if env:
        host = ENVS['environments'][env]['host']
        port = int(ENVS['environments'][env]['port'])
    return redis.Redis(host, port)

def _get_rdm(request):
    env = request.cookies.get('currentEnvironment')
    host = 'localhost'
    port = 6379
    if env:
        host = ENVS['environments'][env]['host']
        port = int(ENVS['environments'][env]['port'])
    return rdm.RedisDataManager(host=host, port=port)


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)
    app.debug = True
Exemplo n.º 2
0
from redis_explorer import app
app.run(host='0.0.0.0', port=5000, debug=True)