We have signals for creating and deleting neomodel
node instances based on creation and deletion of mysql instances.
On a hosted system, when calling functions through shell or custom management commands it's working perfectly fine and signals are called and nodes are created.
However, when calling our API endpoints, they return the following error:
Cannot resolve address 09f3562c.databases.neo4j.io:7687
Our code for signals:
@receiver(post_save,sender=settings.AUTH_USER_MODEL)
def create_personNode(sender,instance=None,created=None,**kwargs):
if created:
if not instance.is_internal:
personNode = Person(did=instance.id,uid=instance.uid)
# personNode.created_at = instance.created_at
personNode.save()
if instance.email:
personNode.email = instance.email
personNode.save()
if instance.phone:
personNode.phone = instance.phone
personNode.save()
else:
pass
else:
if not instance.is_internal:
personNode = Person.nodes.get(did=instance.id)
if instance.email:
personNode.email = instance.email
personNode.save()
if instance.phone:
personNode.phone = instance.phone
personNode.save()
@receiver(post_delete,sender=Users)
def deletePersonNode(sender,instance=None,**kwargs):
if instance is not None: #and (not instance.is_superuser) and (not instance.is_staff):
try:
personNode = Person.nodes.get(did=instance.id)
except:
personNode = None
if personNode is not None:
personNode.total_delete()
I am using the latest versions of neomodel and neo4j:
- neo4j 5.8.0
- neobolt 1.7.17
- neomodel 5.0.0
- Django 4.0.2
- djangorestframework 3.13.1