0

I am trying to implement neomodel package in my Django code which is designed as a back-end service. The problem I am facing is that I already established a PostgreSQL connection from Django but I am facing difficulty in in using the same database for neomodel. From the official neomodel website, I can see:

from neomodel import db
db.set_connection('bolt://neo4j:neo4j@localhost:7687')

Is there any feasible solution for me to connection to an external database to neomodel for graph analytics? Any help would be appreciated.

Thanks, Winston

1 Answers1

0

Try to use

from neomodel import db as neodb
neodb.set_connection('bolt://neo4j:neo4j@localhost:7687')

This code imports object called db from namespace neomodel into the current namespace and gives it the alias neodb

  • 1
    Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes. – Pouria Hemi Nov 16 '20 at 09:30