Git Product home page Git Product logo

django-neomodel's Introduction

Django Neomodel (beta!)

neomodel

This module allows you to use the neo4j graph database with Django using neomodel

Warnings

Live Examples (add yours here)

Getting started

Install the module:

$ pip install django_neomodel

Add the following settings to your settings.py:

NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL', 'bolt://neo4j:foobarbaz@localhost:7687')

# Make sure django_neomodel comes before your own apps
INSTALLED_APPS = (
    # django.contrib.auth etc
    'django_neomodel',
    'yourapp'
)

Write your first node definition in yourapp/models.py:

from neomodel import StructuredNode, StringProperty, DateProperty

class Book(StructuredNode):
    title = StringProperty(unique_index=True)
    published = DateProperty()

Create any constraints or indexes for your labels. This needs to be done after you change your node definitions much like manage.py migrate:

$ python manage.py install_labels

Now in a view yourapp/views.py:

from .models import Book

def get_books(request):
    return render('yourapp/books.html', request, {'books': Book.nodes.all()})

In your yourapp/admin.py:

from django_neomodel import admin as neo_admin
from .models import Book

class BookAdmin(dj_admin.ModelAdmin):
    list_display = ("title", "created")
neo_admin.register(Book, BookAdmin)

And you're ready to go. Don't forget to check the neomodel_ documentation.

Model forms

Switch the base class from StructuredNode to DjangoNode and add a 'Meta' class:

from datetime import datetime
from django_neomodel import DjangoNode
from neomodel import StructuredNode, StringProperty, DateTimeProperty, UniqueIdProperty

class Book(DjangoNode):
    uid = UniqueIdProperty()
    title = StringProperty(unique_index=True)
    status = StringProperty(choices=(
            ('Available', 'A'),
            ('On loan', 'L'),
            ('Damaged', 'D'),
        ), default='Available')
    created = DateTimeProperty(default=datetime.utcnow)

    class Meta:
        app_label = 'library'

Create a model form class for your DjangoNode:

class BookForm(ModelForm):
    class Meta:
        model = Book
        fields = ['title', 'status']

This class may now be used just like any other Django form.

Settings

The following config options are available in django settings (default values shown). These are mapped to neomodel.config as django is started:

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

Signals

Signals work with DjangoNode sub-classes:

from django.db.models import signals
from django_neomodel import DjangoNode
from neomodel import StringProperty

class Book(DjangoNode):
  title = StringProperty(unique_index=True)

def your_signal_func(sender, instance, signal, created):
    pass

signals.post_save.connect(your_signal_func, sender=Book)

The following are supported: pre_save, post_save, pre_delete, post_delete. On freshly created nodes created=True in the post_save signal argument.

Testing

You can create a setup method which clears the database before executing each test:

from neomodel import db, clear_neo4j_database

class YourTestClass(DjangoTestCase):
    def setUp(self):
        clear_neo4j_database(db)

    def test_something(self):
        pass

Management Commands

The following django management commands have been included.

install_labels

Setup constraints and indexes on labels for your node definitions. This should be executed after any schema changes:

$ python manage.py install_labels
Setting up labels and constraints...

Found tests.someapp.models.Book
+ Creating unique constraint for title on label Book for class tests.someapp.models.Book
Finished 1 class(es).

clear_neo4j

Delete all nodes in your database, warning there is no confirmation!

Requirements

  • Python 3.8+
  • neo4j 5.x, 4.4 (LTS)

Docker Example

Using Docker Compose.

Commands to setup Docker Container docker-entrypoint.sh:

# Go to tests
$ cd tests/
# Docker Command (Make sure Docker is running and up to date)
$ docker-compose up
# login in admin with username=admin password=1234

Go to http://localhost:7474/browser/

Go to http://localhost:8000/admin/

Running Tests

Setup Neo4j Desktop with a local database with password 'foobarbaz' and version 5.x or 4.4.x (Neo4j LTS version).

Commands to run tests:

# create local venv and install dependencies.
$ pip install -e '.[dev]'; export DJANGO_SETTINGS_MODULE=tests.settings;
$ tests/manage.py install_labels
$ tests/manage.py migrate
$ pytest

# example output:

platform darwin -- Python 3.9.0, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
pick 0900469 Neo4J-update-t-4.1
collected 16 items

someapp/tests/test_atomicity.py .                                                                                                                                                                                                                      [  6%]
someapp/tests/test_commands.py ..                                                                                                                                                                                                                      [ 18%]
someapp/tests/test_model_form.py ...........                                                                                                                                                                                                           [ 87%]
someapp/tests/test_sanity.py .                                                                                                                                                                                                                         [ 93%]
someapp/tests/test_signals.py .
16 passed, 11 warnings in 1.62s

django-neomodel's People

Contributors

adriancarayol avatar biwin avatar devinbarry avatar evdh0 avatar mariusconjeaud avatar mattgalvis avatar nossila avatar partybison917584020184 avatar robinedwards avatar whatsocks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-neomodel's Issues

Status of Project

Hello was wondering if there is a status for this project. I seen it has not been updated since June 2017. I am asking because I am curious about making a microservice with a graph db backend.

CypherSyntaxError:The old parameter syntax `{param}` is no longer supported. Please use `$param` instead. in noemodel v3.3 not in neo4j v4.1

This issue is resolved in neo4j v4.1 update. But my question is related to neomodel v3.3. How do we resolve this issue in neomodel v3.3.

My queries: I have models.py as

from neomodel import StructuredNode, StringProperty, UniqueIdProperty()

class Person(StructuredNode):
  person_id = UniqueIdProperty()
  person_name = StringProperty()

when i execute

python manage.py install_labels
it works fine with no errors

$ python manage.py install_labels
Setting up indexes and constraints...

Found django_neomodel.DjangoNode
 ! Skipping class django_neomodel.DjangoNode is abstract
Found neo4japp.models.Person
 + Creating unique constraint for person_id on label Person for class neo4japp.models.Person

Finished 2 classes.

But when I create its object like

modiji = Person(person_id='1', person_name='modiji').save()

it gives me this error

CypherSyntaxError: The old parameter syntax `{param}` is no longer supported. Please use `$param` instead (line 1, column 18 (offset: 17)) "CREATE (n:Person {create_params}) RETURN n"

As in OGM we cant manipulate cypher queries how do i make it work. Please help. I want to make use of OGM and dont want to hard code cypher queries to make my code effectively using django framework & neomodel

If not then what is the alternative to neomodel to use OGM queries like the one in ORM so as to ease the database quering stuff?

ValidationError on ModelForms with excluded fields

I think there is a bug in the way django_neomodel and/or neomodel tries to validate ModelForms for DjangoNodes. I have a DjangoNode with some required fields and, through neomodel (not through a Django ModelForm), created an instance of it. I then created a ModelForm to update a subset of the fields, excluding some of the required fields. When I try to submit this form, I get neomodel.exception.RequiredProperty, which causes django.core.exceptions.ValidationError, which causes ValueError. It tells me that one of the required properties is required, and it complains that I do not have it included in the ModelForm.

At django_neomodel/__init__.py, in DjangoNode's full_clean() method, the required fields that I did not include in my ModelForm are removed from the list of properties to be validated before calling deflate().

At neomodel/properties.py, in PropertyManager's deflate() method, the full list of properties is pulled from the DjangoNode to validate the properties provided by full_clean(). Iterating through the full list of properties, it soon lands on one of the required properties that was not included in the ModelForm and raises the neomodel.exception.RequiredProperty.

I'm not exactly sure where the change needs to be happen, but I'm pretty certain this is a bug.

Create a node with multiple labels

When defining models, is it possible to register nodes of a model with multiple labels? Perhaps through something like class Meta?

Better yet, dynamically?

[Aura 4.0] python manage.py install_labels error with aura 4.0

I see that some changes were made to work with neo4j+s format in the following PR:
4398851

Attempt 1: using neo4j format
If I don't change neomodel/neomodel/config.py encrypted to be True then I get the following error when running python manage.py install_labels using a neo4j URL, without the +s

\venv\lib\site-packages\neo4j\io\__init__.py", line 1042, in update_routing_table
    raise ServiceUnavailable("Unable to retrieve routing information")
neo4j.exceptions.ServiceUnavailable: Unable to retrieve routing information

Attempt 2: using neo4j+s format
If I do use the neo4j+s URL format then I get this other error:

\venv\lib\site-packages\neo4j\__init__.py", line 172, in driver
    URI_SCHEME_NEO4J_SECURE,
neo4j.exceptions.ConfigurationError: The config settings 'encrypted' and 'trust' can only be used with the URI schemes ['bolt', 'neo4j']. Use the other URI schemes ['bolt+ssc', 'bolt+
s', 'neo4j+ssc', 'neo4j+s'] for setting encryption settings.

Not sure if there is another way around this without changing the config file mentioned above in attempt 1.

How to serialize queryset?

Hey there. I've been using django-neomodel for a long time and am starting to get into Pandas/GraphFrames and Pandas/Scikit. How can I serialize my nodeset into a generic data type like a python dictionary or JSON?

I know I could just grab the data with Cypher or a JSONresponse API call, but that kind of defeats the purpose of the library.

I've attempted all sorts of conversions and iterations: json and dict and dataframe attempts.

How to unlazily load values?

a = MyModel.nodes.all()[0].defined_properties().copy
pd.DataFrame.from_dict([a()])

image

Trying to iterate over a node in every row of a df I just keep winding up back at the django-neomodel class.

list_bucket = []
all_rows = raw_df.iloc[:,0]
for r in all_rows:
    row_as_series = pd.Series(r)
    list_bucket.append(row_as_series)

type(list_bucket[0][0])

[2]  my_app.my_models.MyModel

Perhaps I could somehow super() into the parent class neomodel nodeset.__properties__ ?

MyModel.__class__

[3] neomodel.core.NodeMeta

Issue with connecting

Hi, I have a neo4j database running on localhost:7687, called "test_db."
The neo4j user has a password, let's just say it's "password."

I added the following code to the settings.py file in my Django project.

from neomodel import config
config.DATABASE_URL = 'bolt://neo4j:password@localhost:7687'

When I go to run python manage.py install_labels I get the following error:
ValueError: Invalid IP address 'fe80::1%lo0'

I know that a similar issue was posted a while ago, but the solution to that error was to remove special characters from the password. My password only includes letters and numbers.

I don't know if it matters, but within this project there is an already existing app with a Postgres database. I'm setting up a second app which will be using a neo4j database.

The full stack trace is:

Found trajectory.models.Person
 + Creating unique constraint for name on label Person for class trajectory.models.Person
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/django_neomodel/management/commands/install_labels.py", line 12, in handle
    install_all_labels(stdout=self.stdout)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neomodel/core.py", line 125, in install_all_labels
    install_labels(cls, quiet=False, stdout=stdout)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neomodel/core.py", line 102, in install_labels
    cls.__label__, db_property))
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neomodel/util.py", line 31, in wrapper
    _db.set_connection(config.DATABASE_URL)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neomodel/util.py", line 65, in set_connection
    max_pool_size=config.MAX_POOL_SIZE)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neo4j/v1/api.py", line 128, in driver
    return driver_class(uri, **config)
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neo4j/v1/direct.py", line 77, in __init__
    pool.release(pool.acquire())
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neo4j/v1/direct.py", line 47, in acquire
    connection = self.acquire_direct(address)  # should always be a resolved address
  File "/Users/michaelnagler/klausen_lab/work_station/lib/python2.7/site-packages/neo4j/bolt/connection.py", line 427, in acquire_direct
    raise ValueError("Invalid IP address {!r}".format(address[0]))
ValueError: Invalid IP address 'fe80::1%lo0'

[Admin] Nodes with Inheritance / Multiple Labels

I'm setting up inheritance according to:
https://neomodel.readthedocs.io/en/latest/relationships.html#relationships-and-inheritance

This is an example models.py

from django_neomodel import DjangoNode
from neomodel import StringProperty

class BaseNode(DjangoNode):
    uid = UniqueIdProperty(primary_key=True)
    created_at = DateTimeProperty(default_now=True)
    
#  Inherit some basic properties from BaseNode
class SecondModel(BaseNode):
    property_1 = StringProperty()

This works perfectly, however when accessing the admin (/admin/myapp/secondmodel/) for this model the following error is thrown:

django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/util.py", line 185, in _object_resolution
django_app  |     resolved_object = self._NODE_CLASS_REGISTRY[frozenset(a_result_attribute[1].labels)].inflate(
django_app  | KeyError: frozenset({'SecondModel'})
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 145, in _get_response
django_app  |     response = self.process_exception_by_middleware(e, request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 143, in _get_response
django_app  |     response = response.render()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render
django_app  |     self.content = self.rendered_content
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
django_app  |     return template.render(context, self._request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
django_app  |     return self.template.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render
django_app  |     return compiled_parent._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render
django_app  |     return compiled_parent._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
django_app  |     result = block.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
django_app  |     result = block.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/templatetags/base.py", line 33, in render
django_app  |     return super().render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/library.py", line 214, in render
django_app  |     _dict = self.func(*resolved_args, **resolved_kwargs)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/templatetags/admin_list.py", line 342, in result_list
django_app  |     'results': list(results(cl)),
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/contrib/admin/templatetags/admin_list.py", line 317, in results
django_app  |     for res in cl.result_list:
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/match.py", line 527, in __iter__
django_app  |     return (i for i in self.query_cls(self).build_ast()._execute())
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/match.py", line 499, in _execute
django_app  |     results, _ = db.cypher_query(query, self._query_params, resolve_objects=True)
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/util.py", line 35, in wrapper
django_app  |     return func(self, *args, **kwargs)
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/util.py", line 236, in cypher_query
django_app  |     results = self._object_resolution(results)
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/util.py", line 197, in _object_resolution
django_app  |     raise ModelDefinitionMismatch(a_result_attribute[1], self._NODE_CLASS_REGISTRY)
django_app  | neomodel.exceptions.ModelDefinitionMismatch: <unprintable ModelDefinitionMismatch object>
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 333, in get_traceback_html
django_app  |     c = Context(self.get_traceback_data(), use_l10n=False)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 324, in get_traceback_data
django_app  |     c['exception_value'] = str(self.exc_value)
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
django_app  |     response = get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 94, in __call__
django_app  |     response = response or self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  |
django_app  | During handling of the above exception, another exception occurred:
django_app  |
django_app  | Traceback (most recent call last):
django_app  |   File "/usr/local/lib/python3.9/wsgiref/handlers.py", line 137, in run
django_app  |     self.result = application(self.environ, self.start_response)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
django_app  |     return self.application(environ, start_response)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/wsgi.py", line 133, in __call__
django_app  |     response = self.get_response(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 75, in get_response
django_app  |     response = self._middleware_chain(request)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 36, in inner
django_app  |     response = response_for_exception(request, exc)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
django_app  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 125, in handle_uncaught_exception
django_app  |     return debug.technical_500_response(request, *exc_info)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 94, in technical_500_response
django_app  |     html = reporter.get_traceback_html()
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/views/debug.py", line 334, in get_traceback_html
django_app  |     return t.render(c)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 171, in render
django_app  |     return self._render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 163, in _render
django_app  |     return self.nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 209, in render
django_app  |     nodelist.append(node.render_annotated(context))
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 244, in render
django_app  |     return nodelist_true_output or self.nodelist_true.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 309, in render
django_app  |     return nodelist.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 936, in render
django_app  |     bit = node.render_annotated(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 903, in render_annotated
django_app  |     return self.render(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 986, in render
django_app  |     output = self.filter_expression.resolve(context)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 697, in resolve
django_app  |     new_obj = func(obj, *arg_vals)
django_app  |   File "/usr/local/lib/python3.9/site-packages/django/template/defaultfilters.py", line 42, in _dec
django_app  |     args[0] = str(args[0])
django_app  |   File "/usr/local/lib/python3.9/site-packages/neomodel/exceptions.py", line 62, in __str__
django_app  |     node_labels = ",".join(self.db_node_class.labels())
django_app  | TypeError: 'frozenset' object is not callable
django_app  | [27/Jul/2021 15:50:50] "GET /admin/myapp/secondmodel/ HTTP/1.1" 500 59

unit test integration

The test harness for a Django application has to be able to do several things:

  • Connect to a database which is separate from the database used by runserver.
  • Run tests from multiple processes (using test --parallel) without concurrent tests interfering with each other.

strange error after following guideline

Hi,

I was trying to get the module for django/neo4j up but i encountered the following message:
Do you have an idea what went wrong?

$ python
Python 3.6.0 (default, Mar 23 2017, 13:21:20)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

exit()
(portal_neo4j)
samdeleu at Sam.local in ~/.../Mind4Energy/portal_neo4j/p1
$ python manage.py install_labels
Setting up indexes and constraints...

Found django_neomodel.DjangoNode
! Skipping class django_neomodel.DjangoNode is abstract
Found p1a.models.Book

  • Creating unique constraint for title on label Book for class p1a.models.Book
    Traceback (most recent call last):
    File "manage.py", line 22, in
    execute_from_command_line(sys.argv)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/django/core/management/init.py", line 363, in execute_from_command_line
    utility.execute()
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/django/core/management/init.py", line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/django_neomodel/management/commands/install_labels.py", line 12, in handle
    install_all_labels(stdout=self.stdout)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/core.py", line 70, in install_all_labels
    install_labels(cls, quiet=False, stdout=stdout)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/core.py", line 47, in install_labels
    cls.label, key))
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/util.py", line 27, in wrapper
    self.set_connection(config.DATABASE_URL)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/util.py", line 63, in set_connection
    self.refresh_connection()
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/util.py", line 28, in wrapper
    return func(self, *args, **kwargs)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neomodel/util.py", line 70, in refresh_connection
    self._session = self.driver.session()
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/v1/bolt.py", line 51, in session
    return BoltSession(self.pool.acquire(self.address))
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 459, in acquire
    connection = self.connector(address)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/v1/bolt.py", line 46, in
    pool = ConnectionPool(lambda a: connect(a, security_plan.ssl_context, **config))
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 615, in connect
    return Connection(s, der_encoded_server_certificate=der_encoded_server_certificate, **config)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 256, in init
    self.buffering_socket = BufferingSocket(self)
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 99, in init
    self.address = Address(*self.socket.getpeername())
    TypeError: new() takes 3 positional arguments but 5 were given
    Exception ignored in: <bound method Connection.del of <neo4j.bolt.connection.Connection object at 0x1074373c8>>
    Traceback (most recent call last):
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 289, in del
    self.close()
    File "/Users/samdeleu/Repositories/Git/Mind4Energy/portal_neo4j/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 419, in close
    self.channel.socket.close()
    AttributeError: 'Connection' object has no attribute 'channel'
    (portal_neo4j)

updated_at

Hey there. I am attempting to implement an updated_at = DateTimeProperty for my DjangoNode

created_at = DateTimeProperty(default_now=True)
updated_at = DateTimeProperty(default_now=datetime.now)

^ this does not update when I edit my DjangoNode

And if I attempt, instance.updated = datetime.now followed by instance.save in my update view then it throws the following error:

Attempting to **deflate** property 'updated_at' on <MyInstance...
  File "/path.../site-packages/neomodel/properties.py", line 119, in _validator
    raise exc_class(self.name, self.owner, str(e), obj)

Trying to do Traversal or equivalent

Trying to figure out how to get all teams that have a given team as their rival.

$ team.rivals.all()
[<Team: {'uid': '280666767cb847b5b33662a34d8fdad8', ... }>]

$ Team.nodes.get(rivals=team)
*** ValueError: No such property rivals on Team
#   =(
class Team(DjangoNode):
bosses = RelationshipTo('Team', 'RIVAL_TO', model=RivalRel)

close

close. fixed it myself

Trying to setup constraints and indexes

Hey there I'm trying to create a new project on Django and to connect it to Neo4J.
I'm a kind of nooby in Neo4J, had some expirience with Django :)
I created two types of nodes Person and Country and tried to add the constraints or indexes need to be added to Neo4j
I'm not sure that I ran the correct commend

neomodel_install_labels neomodel_init.py someapp.models --db bolt://neo4j:
Traceback (most recent call last):
File "/home/dan/Python_Environments/django_neomodel/bin/neomodel_install_labels", line 67, in
main()
File "/home/dan/Python_Environments/django_neomodel/bin/neomodel_install_labels", line 58, in main
load_python_module_or_file(app)
File "/home/dan/Python_Environments/django_neomodel/bin/neomodel_install_labels", line 30, in load_python_module_or_file
import_module(module_name, package=pkg)
File "/home/dan/Python_Environments/django_neomodel/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 956, in _find_and_load_unlocked
ImportError: No module named 'neomodel_init'

Atomic transactions with two databases.

Hi,

I'm trying to wrap two transactions with different databases, but Django does not recognize the name of database (or i'm putting the name of the neo4j database badly 😃)

My code:

with transaction.atomic(using='default'):
    with transaction.atomic(using='neo4j_db'):
        PostgreSQLModel.objects.create(foo=foo)
        Neo4JModel(foo=foo).save()

Thanks.

install_labels is called before app is initialized

It seems that defining a node as a child of DjangoNode result in install_labels being called before the app is initialized with project settings, causing the connection to fail if you have changed the neo4j user or password. See the following stack trace:

Traceback (most recent call last):
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/django/apps/config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/media/pawantu/Data/git/omnidia/neograph/models.py", line 11, in <module>
    class Dataset(DjangoNode):
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/core.py", line 104, in __new__
    install_labels(inst)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/core.py", line 42, in install_labels
    cls.__label__, key))
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/util.py", line 27, in wrapper
    self.set_connection(config.DATABASE_URL)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/util.py", line 60, in set_connection
    self.refresh_connection()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/util.py", line 28, in wrapper
    return func(self, *args, **kwargs)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neomodel/util.py", line 67, in refresh_connection
    self._session = self.driver.session()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/session.py", line 148, in session
    session = Session(self)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/session.py", line 461, in __init__
    self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 465, in connect
    return Connection(s, der_encoded_server_certificate=der_encoded_server_certificate, **config)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 237, in __init__
    self.fetch()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 326, in fetch
    self.acknowledge_failure()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 273, in acknowledge_failure
    fetch()
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 311, in fetch
    raw.writelines(self.channel.chunk_reader())
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 169, in chunk_reader
    chunk_header = self._recv(2)
  File "/media/pawantu/Data/isolated/virtualenvs/omnidia/lib/python3.5/site-packages/neo4j/v1/connection.py", line 152, in _recv
    raise ProtocolError("Server closed connection")
neo4j.v1.exceptions.ProtocolError: Server closed connection

Improve Instructions for Registering Admin

Can i see the structure in the admin interface?
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
how have to Authentication in django-neomodel

Migrations fail

Trying to get this working but as soon as I add the following to my settings.py

NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL', 'bolt://neo4j:test@localhost:7687')

INSTALLED_APPS = (
# django.contrib.auth etc
'django_neomodel',
'yourapp'
)

I get an error in migrations... can not move on ... here is the error:

python manage.py showmigrations
Traceback (most recent call last):
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\apps\registry.py", line 152, in get_app_config
return self.app_configs[app_label]
KeyError: 'admin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management_init_.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management_init_.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management\base.py", line 350, in execute
self.check()
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management\base.py", line 379, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\management\base.py", line 366, in run_checks
return checks.run_checks(**kwargs)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\checks\registry.py", line 71, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\urls\resolvers.py", line 396, in check
for pattern in self.url_patterns:
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\utils\functional.py", line 37, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\urls\resolvers.py", line 533, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\utils\functional.py", line 37, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\urls\resolvers.py", line 526, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Users\dcrom\AppData\Local\Programs\Python\Python37-32\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\Users\dcrom\PycharmProjects\dgv02\dgv02\urls.py", line 20, in
path('admin/', admin.site.urls),
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\utils\functional.py", line 213, in inner
self._setup()
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\contrib\admin\sites.py", line 526, in _setup
AdminSiteClass = import_string(apps.get_app_config('admin').default_site)
File "C:\Users\dcrom\PycharmProjects\dgv02\venv\lib\site-packages\django\apps\registry.py", line 159, in get_app_config
raise LookupError(message)
LookupError: No installed app with label 'admin'.

neomodel 4.0.1 incompatibility

neomodel 4.0.1 has changed MAX_POOL_SIZE in config.py to MAX_CONNECTION_POOL_SIZE
This now causes django_neomodel to fail in apps.py during startup

DRF example with basic CRUD, serializer, viewset

It would be useful to see an example of how to define a serializer, viewset, and perform basic CRUD on a neomodel. How well does neomodel work with Django REST Framework? Are there any 'gotchas' that new projects should be aware of when adopting neomodel and DRF?

Does django-neomodel work with Django's ContentTypes?

I was wondering whether it is possible to use Django's ContentType system with django-neomodel. Are all of the features available?

On a similar note, what if I need to create one relationship on a model that connects ModelA1 to either ModelB1 or ModelC1 (ModelB1 and ModelC1 are from different labels)? I believe that is possible if I utilize Cypher, is it possible in django-neomodel?

Cannot integrate with graphene-django

Not sure whose issue this is, but just putting it out here. Graphene provides Python library for providing graphql interfaces.

Graphene-django provides django integration, and models can be provided to the Graphql scheme in the following way -

class Meta:
    model = mymodel

The requirement is that the model be of type django.db.models.Model.

Unfortunately, django-neomodel's DjangoNode is not, and so the integration fails. Any thoughts?

[Admin] implement choices with Django framework

I simply want to have a dropdown with country and save its code to neo4j as a string property. I am able to generate the drop down but it doesn't match what I want to achieve.

models.py

COUNTRY_CODE1=[("AF", 'Afghanistan'), ('BL', 'Albania'), ('DZ', 'Algeria')]

class Person(DjangoNode):
    uid_person = UniqueIdProperty()
    ind_name = StringProperty(max_length=100 , label='Enter your First Name',required=True)
    ind_last_name = StringProperty(max_length=100,null=True, label='Last Name',required=True)

ind_nationality = StringProperty(max_length=2,choices=COUNTRY_CODE1,label='Nationality',required=True) 
    class Meta:
        app_label = 'reg'

forms.py

    class Meta:
        model=Person
        fields = ['ind_name','ind_last_name', 'ind_nationality']#,'ind_country']#,'ind_address1','ind_address2','ind_address3', 'ind_town','ind_postcode','ind_state', 'ind_birthdate','ind_gender','ind_email','ind_countryiddcode','ind_contactnum']
        widgets = {

            'ind_name' : forms.TextInput(attrs={'size':50}),
            'ind_last_name' : forms.TextInput(attrs={'size':50}),
            'ind_nationality' : forms.Select(),
       
        }
        app_label = 'reg'

views.py

class PersonRegView(generic.FormView):
    template_name='reg/personreg.html'
    form_class=PersonRegForm
    success_url = 'index'

    def post(self, request, *args, **kwargs):

        self.object = None
        form_class = self.get_form_class()
        form = self.get_form(form_class)
        print('view post',form)

   
        if (form.is_valid()): 
            return self.form_valid(form)
        else:
            #print(x)
            return self.form_invalid(form)

    def form_valid(self, form):
        self.object = form.save()
        #return HttpResponseRedirect(self.get_success_url())
        return HttpResponseRedirect(self.request.path_info)

    def form_invalid(self, form):
        
        return self.render_to_response(
            self.get_context_data(form=form)
            )

html template - using bootstrap4.

<div class="row justify-content-center">
        <div class="media-container-column col-lg-8" > <!-- data-form-type="formoid"-->
                <div data-form-alert="" hidden="">
                    {%bootstrap_form_errors form%}
                </div>

                <form class="mbr-form" action="#" method="post" data-form-title="PersonRegForm">

                  {% csrf_token %}

                  <div class="row row-sm-offset">
                    <div class = "col-sm-12"><h3> Personal Information </h3></div>

                      <div class="col-md-6 multi-horizontal" data-for="name">
                          {%bootstrap_field form.ind_name show_label=False%}
                      </div>
                     <div class="col-md-6 multi-horizontal" data-for="name">
                          {%bootstrap_field form.ind_last_name show_label=False%}
                      </div>
                      <div class="col-md-6 multi-horizontal" data-for="name">
                           {%bootstrap_field form.ind_nationality show_label=True %}
                       </div>

                  </div>


                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-primary btn-form display-4">SEND FORM</button>
                    </span>
                </form>
        </div>

    </div>

My output shows that for the choices appears like this.

<select name="ind_nationality" class="form-control is-invalid" title="" required="" id="id_ind_nationality">
  <option value="">---------</option>

  <option value="A">F</option>

  <option value="B">L</option>

  <option value="D" selected="">Z</option>

</select>

I have two problems here . First one being the dropdown is incomplete I am assuming it should display

<option value="AF">Afghanistan</option>

Second problem is that when I try to save it throws an error invalid choice with whatever option selected.

I am able to successfully save it without dropdown choices just the first two fields.

can we create custom data structure/type?

Some python libraries provide their own data format like DataFrame in pandas, tensor in tensorflow or ndarray in numpy and so on,
can we store these data in the nodes in its orignal format via django-neomodel?

migrate.py install_labels - Equivalent constraint already exists

neo4j.exceptions.ClientError: {code: Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists} {message: An equivalent constraint already exists, 'Constraint( id=2, name='constraint_bd9158e1', type='UNIQUENESS', schema=(:Device {uid}), ownedIndex=1 )'.}

Get this when rerunning install_labels. What is the correct workflow for partial migrations when adding a new node class? I can do clear_neo4j but that drops all nodes as well.

Thanks!

How to use DjangoRel Values in Forms

Hoping for some guidance. Would like to add friends to a person when I create the person.

In my person/new form, how can include a friends input value to be handled by the request so that I can save the friends within the person_create method in views.py?

#views.py

def person_create(request):
  form = PersonForm(request.POST or None)
  friends = request.POST.values('friends')

  if form.is_valid():
    form.save()
    if friends(
        for friend in friends (
            person.friend.connect(friend)
        )
    )

Right now, when I try include friends in my PersonForm fields in forms.py like this:
fields = ['name', 'friends']
, it results in the following error:
django.core.exceptions.FieldError: Unknown field(s) (friends) specified for Person

Yet I have the DjangoRel set up within my models.py:

class FriendRel(DjangoRel):
  created_at = DateTimeProperty(default=datetime.now)
  class Meta:
    app_label = 'django_rel'


class Person(DjangoNode):
  uid = UniqueIdProperty()
  created_at = DateTimeProperty(default=datetime.now)

  name = StringProperty(max_length=50)

  friends = RelationshipTo('Person', 'FRIENDS_WITH', model=FriendRel)

Support for multiple connections

I'm thinking about how support for multiple connections/ graph databases could work. I plan to have 1 graph database per organization. However, a user that logs in can belong to many organizations.

One way, I suppose, would be to have each neo4j db running on a different port, and then passing multiple values into NEOMODEL_NEO4J_BOLT_URL = Hmm. How then I could specify which graph a particular model class or query is dealing with? Would I preface each request with django.conf.settings(NEOMODEL_NEO4J_BOLT_URL: my_port)?

Am I overthinking this? Do I just need to add a node for each organization, and make it truly multi-tenant in one massive, shared graph db? Then I would have to prevent them from traversing graphs/ orgs with some sort of scope on their queries?

python-3.7, neo4j-4.0 support

Neo4j v4.0 support should be kept up.

  • python3.7, django2.2 complains in django_neomodel/init.py:122 "choices" is kinda monotonic list

  • neo4j complains in pypi package neomodel The old parameter syntax {param} is no longer supported.

Support with Graphene-Django-Plus

I was trying to implement graphQL with django-neomodel but didn't find it's support in it. Also, I didn't find anything else for it. I request you to please provide a support of it with Graphene-Django-Plus. Why I am saying Graphene-Django-Plus,instead of Graphene or Graphene-Django because it has some goodness like Permission manager, query Optimization and inbuilt Authentication.

problem with install_labels

Hi,
I just created my model classes but I'm still stuck at the very first step which is calling "python manage.py install_labels"
it seems that there's a problem with the variable MAX_BOOL_SIZE in neomodel.config, which I searched for but found "MAX_CONNECTION_POOL_SIZE" instead.
anyway I'm using:

  • python 3.7
  • django 3.1.1
  • neo4j 4.1.1
  • neomodel 4.0.1
  • django-neomodel 0.0.4

here's the error I get:
Traceback (most recent call last):
File "manage.py", line 22, in
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management_init_.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management_init_.py", line 377, in execute
django.setup()
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", line 122, in populate
app_config.ready()
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django_neomodel\apps.py", line 20, in ready
self.read_settings()
File "C:\Users\Alhassan\AppData\Local\Programs\Python\Python37\lib\site-packages\django_neomodel\apps.py", line 17, in read_settings
config.MAX_POOL_SIZE = getattr(settings, 'NEOMODEL_MAX_POOL_SIZE', config.MAX_POOL_SIZE)
AttributeError: module 'neomodel.config' has no attribute 'MAX_POOL_SIZE'

DjangoNode's post_save AttributeError: no attribute '_creating_node'

Getting the following error when attempting to update a DjangoNode via a Forms save() method.

Traceback (most recent call last):
  File "/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/views.py", line 38, in save
    form.save()
  File "/django/forms/models.py", line 451, in save
    self.instance.save()
  File "/neomodel/hooks.py", line 11, in hooked
    _exec_hook('post_' + fn_name, self)
  File "/neomodel/hooks.py", line 3, in _exec_hook
    getattr(self, hook_name)()
  File "/django_neomodel/__init__.py", line 193, in post_save
    created = self._creating_node
AttributeError: '<name_of_DjangoNode>' object has no attribute '_creating_node'

Integrating existing / "legacy" neo4j database (like inspectdb)?

Hello django-neomodel-team,

I need to integrate an existing neo4j-database into my django project using your package. Is there any best practice or things I need to consider to do this?

For relational databases django provides the inspectdb command. Is there an equivalent for django-neomodel?

Thank you very much!
Maximilian Endter

Connecting with authorization

I get Invalid IP address 'fe80::1%lo0' when calling .save(). Also tried install_labels and I have the same error. Can anyone say how to connect with server if auth is enabled? How to get the bolt url? Now I'm using the default config for url.

Extend DjangoNode to be used in Django Restframework ModelSerializers

Dear Devs,
I am working on building full support for django rest framework.
This includes a README over 1000 Lines with full examples on how to build a self documenting rest api specified with OpenAPI 3.0

Problem

Everything works perfect expect for the edge case that the parameters for POST request are separated with hyphen instead of underscores. Everything brakes if properties of a node are in hyphen case (test-name) instead of (test_name)

What i have tried

I have tried a few different approaches.

  • Using DjangoNode instead of structured Node
    According to drf you can then pass extra agrs, where the conversion happens. sadly because Django Node is not functionally equivalent to django.model this brakes
Traceback (most recent call last):
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/mixins.py", line 18, in create
    serializer.is_valid(raise_exception=True)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 220, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 419, in run_validation
    value = self.to_internal_value(data)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 472, in to_internal_value
    for field in fields:
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 355, in _writable_fields
    for field in self.fields.values():
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 349, in fields
    for key, value in self.get_fields().items():
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 1028, in get_fields
    info = model_meta.get_field_info(model)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/utils/model_meta.py", line 35, in get_field_info
    opts = model._meta.concrete_model._meta
AttributeError: 'NoneType' object has no attribute '_meta'
[15/Jan/2021 23:06:42] "POST /mud/ HTTP/1.1" 500 20683

Traceback (most recent call last):
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/mixins.py", line 19, in create
    self.perform_create(serializer)
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/mixins.py", line 24, in perform_create
    serializer.save()
  File "/home/s0/Code/Learn/Neo4JProjects/neo4things/env/lib/python3.9/site-packages/rest_framework/serializers.py", line 205, in save
    self.instance = self.create(validated_data)

The issue here is that the conversion happens correctly but then i think python is confussed because there is a minus and property name is now an expression

I think the easiest would be to make DjangoNode work in the rest framework. What do you think. Any Ideas how I can get this to work?

If you are interested in my project write me, its going to be published under agpl soon

error

http://127.0.0.1:8000/admin/
I went to go to address error and I did it according to the document but the code was not done.
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

Can't connect django_model to neo4j instance

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

NEOMODEL_NEO4J_BOLT_URL = os.environ.get('NEO4J_BOLT_URL', 'bolt://neo4j:attractora@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:

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 is running and accesible because I connected neo4j browser to it and made changes. I tried with database versions 4.1.3 and 3.5.25, and nothing.

Where else can I look for the reason of this exceptio? Thanks a lot for your help.

Where else can I look for the reason of this exception.

DRF

There is no guide for neomodel and DRF example?

Django-Neomodel AttributeError: module 'neomodel.config' has no attribute 'MAX_POOL_SIZE'

I was just trying to get django-neomodel setup for the first time, following your instructions here and ran into this error:

Traceback (most recent call last):
  File "manage.py", line 31, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/usr/local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/usr/local/lib/python3.8/site-packages/django_neomodel/apps.py", line 20, in ready
    self.read_settings()
  File "/usr/local/lib/python3.8/site-packages/django_neomodel/apps.py", line 17, in read_settings
    config.MAX_POOL_SIZE = getattr(settings, 'NEOMODEL_MAX_POOL_SIZE', config.MAX_POOL_SIZE)
AttributeError: module 'neomodel.config' has no attribute 'MAX_POOL_SIZE'

This error message is getting thrown by the apps.py file in neomodel-django:

 def read_settings(self):
        config.DATABASE_URL = getattr(settings, 'NEOMODEL_NEO4J_BOLT_URL', config.DATABASE_URL)
        config.FORCE_TIMEZONE = getattr(settings, 'NEOMODEL_FORCE_TIMEZONE', False)
        config.ENCRYPTED_CONNECTION = getattr(settings, 'NEOMODEL_ENCRYPTED_CONNECTION', False)
        config.MAX_CONNECTION_POOL_SIZE = getattr(settings, 'NEOMODEL_MAX_CONNECTION_POOL_SIZE', config.MAX_CONNECTION_POOL_SIZE)

It looks like if you set NEOMODEL_MAX_CONNECTION_POOL in the django settings file it should provide the correct value except that wasn't working for me. The default value provided in getattr (config.MAX_CONNECTION_POOL_SIZE) is a property of the neomodel config object / module and is apparently not set by default.

I figured I'd see what happened if I manually set config.MAX_CONNECTION_POOL_SIZE. Good news, it worked! So, I just added this to my settings.py:

from neomodel import config    
config.MAX_POOL_SIZE = 50

I confess I've not used getattr much, so I played around with it to get a better understanding of how it works. Here's the function definition:

 getattr(object, name[, default])

If default is set to an attribute that doesn't exist of an object or module, then getattr immediately throws an AttributeError, even IF the object and name values are valid and would otherwise return a value.

So it seems like this may be a bug in the django-neomodel code? It looks like the library is expecting MAX_CONNECTION_POOL_SIZE to be set in the neomodel config when Django starts, but this is not the case, at least as of 1/22/21 using neomodel 4.0.1 and django-neomodel 0.0.4. I just checked the neomodel source, and the weird thing is, it should have MAX_CONNECTION_POOL_SIZE set by default.

Perhaps I missed something and was supposed to instantiate the config value elsewhere?

Been struggling to get .cypher() working

So close to finishing this app!

from django_neomodel import DjangoNode 
from neomodel import *

class Resource(DjangoNode):
    uid = UniqueIdProperty()
    name = StringProperty()

    class Meta:
        app_label = 'django_node'
    
    def graph_json(self):
        query_string = "MATCH (n)-[r:REPORTS_TO|BRANCH_OF|OVERSEEN_BY]->() RETURN n, r"
        query_results = self.cypher(query_string)
        return json.dumps(query_results)

What is most confusing is that cypher does not work with NodeSet.

(Pdb) Resource.nodes.cypher("some query")
*** AttributeError: 'NodeSet' object has no attribute 'cypher'

(Pdb) Resource.nodes.all().cypher("some query")
*** AttributeError: 'list' object has no attribute 'cypher'

(Pdb) Resource.inflate.cypher("some query")
*** AttributeError: 'function' object has no attribute 'cypher'

django admin interface

Hey,

I have been playing around now.
The python manage.py install_labels seems to work.
Can i see the structure in the admin interface?

Kind regards
Sam

[BUG] ServiceUnavailable: The Neo4J server does not support communication with this driver

My Neo4j is 3.4.5 community edition, but when I try to use it to integrate with Django, raise this:

Traceback (most recent call last):
  File "D:\python-envs\neo4j\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "D:\python-envs\neo4j\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "D:\Projects\Demo-Labs\ngraph\app01\views.py", line 29, in get_nodes
    return render('index.html', {"nodes": Event.nodes.all()})
  File "D:\python-envs\neo4j\lib\site-packages\neomodel\match.py", line 524, in all
    return self.query_cls(self).build_ast()._execute(lazy)
  File "D:\python-envs\neo4j\lib\site-packages\neomodel\match.py", line 499, in _execute
    results, _ = db.cypher_query(query, self._query_params, resolve_objects=True)
  File "D:\python-envs\neo4j\lib\site-packages\neomodel\util.py", line 34, in wrapper
    _db.set_connection(config.DATABASE_URL)
  File "D:\python-envs\neo4j\lib\site-packages\neomodel\util.py", line 101, in set_connection
    self.driver = GraphDatabase.driver(u.scheme + '://' + hostname,
  File "D:\python-envs\neo4j\lib\site-packages\neo4j\__init__.py", line 183, in driver
    return cls.bolt_driver(parsed.netloc, auth=auth, **config)
  File "D:\python-envs\neo4j\lib\site-packages\neo4j\__init__.py", line 199, in bolt_driver
    raise ServiceUnavailable(str(error)) from error
neo4j.exceptions.ServiceUnavailable: The Neo4J server does not support communication with this driver. This driver have support for Bolt
Protocols dict_keys([Version(3, 0), Version(4, 0), Version(4, 1)])

This issue will be resolved when I downgrade neo4j from 4.1.x version to 1.7.6, but raise Can't Import SessionExpire from neo4j.exception exception.


My settings.py:

NEOMODEL_NEO4J_BOLT_URL = 'bolt://<myusername>:<mypassword>@<myip>:7687'
NEOMODEL_SIGNALS = True

My views:

from django_neomodel import DjangoNode
import neomodel
from django.shortcuts import render


class Event(DjangoNode):
    ID = neomodel.IntegerProperty()
    subject = neomodel.StringProperty()

    class Meta:
        app_label = 'test'


def get_nodes(request):
    return render('index.html', {"nodes": Event.nodes.all()})

My index.html template:

<body>
    <div>
    <ul>
        {% for node in nodes %}
            <li> {{ node.ID }} - {{ node.subject }}</li>
        {% endfor %}
    </ul>
    </div>
</body>

my package info:

asgiref==3.3.1
atomicwrites==1.4.0
attrs==20.3.0
backcall==0.2.0
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
colorama==0.4.4
cryptography==3.4.6
decorator==4.4.2
Django==3.1.7
django-neomodel==0.0.6
djangorestframework==3.12.2
docker==4.4.4
english==2020.7.0
idna==2.10
iniconfig==1.1.1
ipython==7.21.0
ipython-genutils==0.2.0
jedi==0.18.0
monotonic==1.5
neo4j==4.1.0
neo4j-driver==4.1.1
neobolt==1.7.17
neomodel==4.0.2
neotime==1.7.4
packaging==20.9
pansi==2020.7.3
parso==0.8.1
pickleshare==0.7.5
pluggy==0.13.1
prompt-toolkit==2.0.10
py==1.10.0
py2neo==2021.0.1
pycparser==2.20
Pygments==2.8.1
pyparsing==2.4.7
pytest==6.2.2
pytz==2021.1
pywin32==227
requests==2.25.1
Shapely==1.7.1
six==1.15.0
sqlparse==0.4.1
toml==0.10.2
traitlets==5.0.5
urllib3==1.26.3
wcwidth==0.2.5
websocket-client==0.58.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.