Search code examples
pythonherokuneo4jpy2neo

Heroku Neo4j Issue


I have my neo4j python application using py2neo. It is working corretly on local but when i deploy it to heroku it is giving error py2neo.rest.SocketError SocketError: gaierror(-2, 'Name or service not known')

I am not sure what is the issue. what should be the correct issue I am using url for db service as graph_db = neo4j.GraphDatabaseService("http://xyz.hosted.neo4j.org:7480/db/data/")


Solution

  • Configure the authentication as indicated here: http://packages.python.org/py2neo/neo4j.html#authentication

    Use heroku config to note the username and password in the URL.

    For example (obviously modified):

    $ heroku config
    === secure-caverns-9214 Config Vars
    NEO4J_URL: http://username:[email protected]:7755
    PATH:      bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin