Reputation: 11
I'm trying to establish a connection to GrapheneDB.
I'm running this code on Spyder and its working perfectly fine.
from neo4j.v1 import GraphDatabase, basic_auth
from flask import Flask
#from py2neo import Graph, Node, Relationship
app = Flask(__name__)
@app.route('/',methods=['POST','GET'])
def hello_world():
driver = GraphDatabase.driver("bolt://hobby-dobhfgnijmdigbkelfmgifdl.dbs.graphenedb.com:24787", auth=basic_auth("username", "password"))
session = driver.session()
# session.run("CREATE (n:Object {name:'Mat'})")
result = session.run("MATCH (n:Object) RETURN n.name AS name")
As soon as I run this code on Server (Pythonanywhere)
Error appears: connect raise ServiceUnavailable("Failed to establish connection to {!r} (reason {})".format(resolved_address, error)) neobolt.exceptions.ServiceUnavailable: Failed to establish connection to ('54.234.36.208', 24787) (reason [Errno 111] Connection refused)
I'm not sure what is wrong. GrapheneDB is also on the whitelist of python anywhere.
Upvotes: 1
Views: 338