Newbie problem:
I'm trying to connect to NEO4J from Django/Vagrant and I keep getting a "ConnectionRefusedError: [Errno 111] Connection refused" when I try to run neomodel_install_labels.
in my settings file I've added:
from neomodel import config
import os
DATABASES = {
'default': env.db('SNAP_DATABASE_URL'),
}
#Connect to Neo4j Database
config.DATABASE_URL = os.environ["NEO4J_BOLT_URL"]
NEOMODEL_SIGNALS = True
NEOMODEL_FORCE_TIMEZONE = False
NEOMODEL_ENCRYPTED_CONNECTION = False
NEOMODEL_MAX_CONNECTION_POOL_SIZE = 50
In my .env.vagrant file
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=test
NEO4J_BOLT_URL="bolt://$NEO4J_USERNAME:$NEO4J_PASSWORD@localhost:7687"
In my model file:
from neomodel import (
config,
StringProperty,
StructuredNode,
RelationshipTo,
RelationshipFrom,
Relationship
)
import os
config.DATABASE_URL = os.environ["NEO4J_BOLT_URL"]
I receive the error when I try to install_labels.
vagrant@ubuntu-focal:/vagrant$ pipenv run neomodel_install_labels data_api.py data_api/models/language.py --db bolt://neo4j:test@localhost:7687
Loading .env environment variables...
Loaded data_api.py.
Loaded data_api/models/language.py.
Connecting to bolt://neo4j:test@localhost:7687
Setting up indexes and constraints...
Found language.Language
+ Creating index node_id on label Language for class language.Language
Traceback (most recent call last):
File "/home/vagrant/.local/share/virtualenvs/vagrant-gKDsaKU3/lib/python3.9/site-packages/neo4j/_async_compat/network/_bolt_socket.py", line 504, in _connect
s.connect(resolved_address)
ConnectionRefusedError: [Errno 111] Connection refused