Search code examples
web2py

How do I use neo4j with Web2py?


I am trying to build a very simple Log-in system. For which I am using neo4j as the database.

As per the documentation, I cannot find a way to connect neo4j to the DAL.

Should I manually connect to neo4j and then start a session or is there a way for me to use the DAL (which allows me to easily take care of log-in)?


Solution

  • In order to use a particular database with the web2py DAL, there must be an adapter for it, and there is no adapter for Neo4j. web2py's built-in Auth system depends on the DAL, so to use it, you must store at least the Auth related data in one of the databases supported by the DAL. Your options are:

    1. Keep everything in Neo4j and therefore do not use web2py's built-in Auth system.
    2. Use an alternative database for the Auth data (you can still use Neo4j for everything else), allowing you to use web2py's Auth system.
    3. Write your own DAL adapter for Neo4j, as explained here.