()
This function establishes a connection
    to the rethinkDB before each connection
This function establishes a connection
    to the rethinkDB before each connection
This function establishes a connection to the rethinkDB before each connection
def before_request():
    '''
    This function establishes a connection
    to the rethinkDB before each connection
    '''
    try:
        g.rdb_conn = r.connect(
            host=app.config['DBHOST'], port=app.config['DBPORT'],
            auth_key=app.config['DBAUTHKEY'], db=app.config['DATABASE'])
    except RqlDriverError:                      # pragma: no cover
        # If no connection possible throw 503 error
        abort(503, "No Database Connection \
                    Could be Established.")
def before_request ( ) : try : g . rdb_conn = r . connect ( host = app . config [ 'DBHOST' ] , port = app . config [ 'DBPORT' ] , auth_key = app . config [ 'DBAUTHKEY' ] , db = app . config [ 'DATABASE' ] ) except RqlDriverError : # pragma: no cover # If no connection possible throw 503 error abort ( 503 , "No Database Connection \
                    Could be Established." )