Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用Django设置OrientDB PyOrient OGM?_Python_Django_Django Models_Orientdb_Pyorient - Fatal编程技术网

Python 如何使用Django设置OrientDB PyOrient OGM?

Python 如何使用Django设置OrientDB PyOrient OGM?,python,django,django-models,orientdb,pyorient,Python,Django,Django Models,Orientdb,Pyorient,我在连接Django和Orientdb PyaOrient OGM时遇到困难 我在Django的settings.py文件中设置了以下连接字符串和初始化方法 # PYORIENT DB SETTINGS DJANGORIENT_SETTINGS = { 'host': 'localhost', 'port': '2480', 'username': 'xxxx', 'password': 'xxxxxxxxxx', 'name': 'authdb' }

我在连接Django和Orientdb PyaOrient OGM时遇到困难

我在Django的settings.py文件中设置了以下连接字符串和初始化方法

# PYORIENT DB SETTINGS
DJANGORIENT_SETTINGS = {
    'host': 'localhost',
    'port': '2480',
    'username': 'xxxx',
    'password': 'xxxxxxxxxx',
    'name': 'authdb'
}

from pyorient.ogm import declarative
Node = declarative.declarative_node()
Relationship = declarative.declarative_relationship()
但是我无法通过models.py文件连接到数据库

from pyorient.ogm.property import *
from .settings import Node

class Car(Node):
    registration = String(unique=True)
    colour = String()

关于如何连接这两种技术有什么建议吗?

Hi@Tommyk,您使用的是哪个版本的OrientDB和Django?您尝试过其中任何一种吗?