How can I connect to a remote cassandra db using Flask?

I can't find any info on Internet about how I can tell my flask app which port it should look at when trying to connect to Cassandra.

From their official website I got:

app = Flask(__name__)
app.config['CASSANDRA_HOSTS'] = ['127.0.0.1']
app.config['CASSANDRA_KEYSPACE'] = "cqlengine"
db = CQLAlchemy(app)

I've tried to add the port to the host with colon or comma and yet nothing. Obviously by default it tries to connect to 9042 and fails miserably.

1 answer