简体   繁体   English

如何为neo4j配置django settings.py?

[英]How to configure django settings.py for neo4j?

I'm trying to write a simple application with django and neo4j. 我正在尝试用django和neo4j编写一个简单的应用程序。

I downloaded neo4j-django-tutorial from github, and run it step by step. 我从github下载了neo4j-django-tutorial ,然后一步一步地运行它。

However, I found that in settings.py of this tutorial, the db is configured as follows: 但是,我发现在本教程的settings.py中,db配置如下:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': join(NEO4JTUT_ROOT, 'db/neo4jtut.sqlite'),
}
}

I doubt that this project is still using sqlite3 as backend db, not neo4j. 我怀疑这个项目仍然使用sqlite3作为后端数据库,而不是neo4j。

What should I do to configure it with neo4j? 我该怎么做才能用neo4j配置它? Thanks. 谢谢。

This project uses both neo4j and sqlite3. 该项目使用neo4j和sqlite3。 As you can see in models.py und views.py in apps/neo4japp nodes are also stored in sqlite3 but some queries are sent to neo4j through new4jclient.py. 正如您在apps / neo4japp中的models.py和views.py中所看到的那样,节点也存储在sqlite3中,但有些查询通过new4jclient.py发送到neo4j。

For using neo4j as a database backand this should help: Developing a web application in python with neo4j 对于使用neo4j作为数据库,这应该有所帮助: 使用neo4j在python中开发Web应用程序

Try the Bulbs Quickstart: http://bulbflow.com/quickstart/ 试试灯泡快速入门: http//bulbflow.com/quickstart/

It's a normal Python library that uses Neo4j Server (which is free) instead of Neo4j Embedded, so you don't have to mess with Java. 这是一个普通的Python库,使用Neo4j Server(免费)而不是Neo4j Embedded,所以你不必乱用Java。 Neo4j Server works better with Web frameworks like Django and Flask. Neo4j Server可以更好地与Django和Flask等Web框架配合使用。

And once you have your app built, you can run it for free on Heroku with the Neo4j Add On. 一旦你建立了你的应用程序,你可以在Neo4j Add On上免费在Heroku上运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM