cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Issue connecting Neo4j in Django

fhol
Node Link

Hi all,

When i follow the simple django neomodel tutorial, i encounter this error when running the following command:

python manage.py install_labels

File "C:\Users\xxxx\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 1139, 
in do_handshake     self._sslobj.do_handshake()
 OSError: [Errno 0] Error

I've the latest versions of both neo4j and python installed.

I found somebody else with the same issue, however it hasn't been solved for him/her as well. If somebody could help me out, it would be highly appreciated.

4 REPLIES 4

I had issues trying to connect to Neo4j version 4 with the python drivers. The same code worked if I down graded Neo4j to version 3.

Thanks a lot! This resolved the issue. Now it results in another internal server error when I open the view in which I request data from the neo4j database in my locally hosted django website:

TypeError: join() argument must be str or bytes, not 'WSGIRequest'

This keeps the issue alive that I'm not able to connect neo4j and django.If anyone could help me out, would be great!

@fhol I've encountered the same error but I'm not using Django - just straight python - but I came across your message on my travels around the internet and thought you may benefit from what I found.

On the neomodel documentation it suggests - "handy for development" - to use this configuration param:

config.ENCRYPTED_CONNECTION = False

See here: https://neomodel.readthedocs.io/en/latest/configuration.html#database

This got me passed the SSL error we both encountered without the need to downgrade neo4j.

HTH

fhol
Node Link

Thanks for your comment, really great to see how helpful people in this community are!

However, I did what you said and still encounter the same issue. So I'll add my settings and installations here:

> pip freeze

asgiref==3.2.7
certifi==2020.4.5.1
chardet==3.0.4
decorator==4.4.2
Django==3.0.6
django-neomodel==0.0.4
idna==2.9
lucene-querybuilder==0.2
neo4django==0.1.8
neo4j==4.0.0
neo4j-driver==1.7.2
neo4jrestclient==2.1.1
neobolt==1.7.17
neomodel==3.3.2
neotime==1.7.4
python-dateutil==2.8.1
pytz==2020.1
requests==2.23.0
six==1.15.0
sqlparse==0.3.1
urllib3==1.25.9

my settings.py:

import os

from neomodel import config

config.ENCRYPTED_CONNECTION = False

config.DATABASE_URL = 'bolt://neo4j:mypassword@localhost:7687'

config.MAX_POOL_SIZE = 50

INSTALLED_APPS = [

    'all my apps'

    'django_neomodel',

]

I also installed openjdk 14.0.1. because I read it was necessary and my OS is windows 10.

Maybe it's because I'm new to neo4j, but I find there is a lot of documentation however it is a bit fragmanted as each tutorial/instruction covers a bit, but I can't find a full instruction of what to do to connect your django application with a neo4j database. Again, it would be great if someone could help me out.

python manage.py install_labels works, but when I use the model in a view and visit http://127.0.0.1:8000/ to watch the data in the model I get the error again:

TypeError: join() argument must be str or bytes, not 'WSGIRequest'