【发布时间】:2013-07-10 07:30:28
【问题描述】:
我正在尝试在托管在Apache 服务器上的django 网站上使用neo4j 数据库。我正在使用neo4django。我已按照http://neo4django.readthedocs.org/en/v0.1.8/index.html 中的说明进行操作。创建节点时,出现以下错误:
error at /disk/ [Errno 111] Connection refused Request
我的models.py:
import django.db
from neo4django.db import models
class Person(django.db.models.Model):
name = django.db.models.CharField(max_length=50, null=True, blank=True)
username = django.db.models.CharField(max_length=50, null=True, blank=True)
password=django.db.models.CharField(max_length=50, null=True, blank=True)
email=django.db.models.CharField(max_length=50, null=True, blank=True)
class Meta:
db_table='lt_profile'
class Pnode(models.NodeModel):
name=models.StringProperty()
#more fields
class Anode(models.NodeModel):
art_type=models.StringProperty(max_length=50)
mtime=models.StringProperty(max_length=200)
#relation:
我的设置.py:
NEO4J_DATABASES = {
'default' : {
'HOST':'localhost',
'PORT': 7474,
'ENDPOINT':'/var/www/graph_db'
}
}
DATABASE_ROUTERS = ['neo4django.utils.Neo4djangoIntegrationRouter']
发生错误的代码:
a = Anode.objects.create(art_type='py', mtime=str(file_mtime))
a.save()
我想我需要更改我在 Apache 中的 port.conf 文件中的某些内容,但我不知道该怎么做。我试过这样的事情:
在ports.conf 中收听 7474,但没有运气。任何帮助将不胜感激。谢谢
【问题讨论】:
-
python 版本:2.7 和 neo4django 版本 1.8
-
我觉得你的endpoint不对——应该是neo4django可以连接的外部路径。没有时间发表评论。
标签: python django apache neo4j neo4django