0

I made these setting on settings.py, as directed on Getting Started:

NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL', 'bolt://neo4j:password@localhost:7687')
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_neomodel',
    'utils'
]

But I only get this error with python manage.py install_labels:

neo4j.exceptions.ServiceUnavailable: [SSLCertVerificationError] Connection Failed. Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. Failed to establish encrypted connection. (code 1: Operation not permitted)

I know the database and neomodel are ok, because neomodel_install_labels models.py --db bolt://neo4j:password@localhost:7687 works perfectly and creates the nodes on the database.

I don't know where I can look for the source of this exception.

HuLu ViCa
  • 5,077
  • 10
  • 43
  • 93

2 Answers2

0

From the neomodel settings :

NEOMODEL_NEO4J_BOLT_URL = 'bolt://neo4j:neo4j@localhost:7687'
NEOMODEL_SIGNALS = True
NEOMODEL_FORCE_TIMEZONE = False
NEOMODEL_ENCRYPTED_CONNECTION = True
NEOMODEL_MAX_POOL_SIZE = 50

You can see that encryption is set to True, which is most probably what the error message is saying ( I doubt your local Neo4j has encryption enabled ).

I would just set encryption to False :

NEOMODEL_ENCRYPTED_CONNECTION = False
Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
0

Well, I found, just by trying different things, that I have to set all neomodels's config.py variables on django's settings.py:

NEOMODEL_NEO4J_BOLT_URL = 'bolt://neo4j:password@localhost:7687'
NEOMODEL_SIGNALS = True
NEOMODEL_FORCE_TIMEZONE = False
NEOMODEL_ENCRYPTED_CONNECTION = False
NEOMODEL_MAX_CONNECTION_POOL_SIZE = 50
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_neomodel',
    'utils'
]

And it finally worked.

HuLu ViCa
  • 5,077
  • 10
  • 43
  • 93