flask - Py2neo searching error -



flask - Py2neo searching error -

im still trying create social network py2neo+flask+neo4j.

i've got problem while searching database py2neo.i wanna find users username includes special string.for illustration users username includes "dav".i wrote code below , dont know why error...

from py2neo import graph graph=graph("http://neo4j:123@localhost:7474/ ") def search(name): users=graph.merge("person") n in users: print n['username']

and error:

traceback (most recent phone call last): file "", line 1, in file "/home/ali/desktop/flask/search.py", line 10, in search users=graph.cypher.execute('match (p:person) homecoming p' file "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 659, in cypher metadata = self.resource.metadata file "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 213, in metadata self.get() file "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 267, in raise_from(self.error_class(message, **content), error) file "/usr/local/lib/python2.7/dist-packages/py2neo/util.py", line 235, in raise_from raise exception py2neo.error.grapherror: http returned response 404

your url wrong, should alter this:

graph("http://neo4j:123@localhost:7474/db/data")

also, can't execute cypher through merge function, instead should this:

users = graph.cypher.execute('match (p:person) homecoming p')

flask neo4j py2neo

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -