I'm trying to do the 'Adding the Driver' Challenge from Building Neo4j Applications with Python using windows and I am struggling. I have followed all the steps and I was able to setup a virtual sandbox environment. I made the following changes to neo4j.py to allow it to connect to the database:
def init_driver(uri, username, password)
# TODO: Create an instance of the driver here
current_app.driver = GraphDatabase.driver("bolt://126.96.36.199:7687", auth=("neo4j", "attesting-strand-cannon"))
However, when i run FLASK it shows invalid syntax. When I click get help and I try to do git checkout 01-connect-to-neo4j, I can't see anything. I'm not sure what I am missing.
From what I can understand, the init_driver function is being defined in neo4j.py and is taking in the uri, username and password. This should be called in another file where these variables are passed (and so defining it like i have in neo4j.py is wrong). But I don't know if this is what is required by the challenge. Also, the test file is also defining functions. Do these need to be called from another python code?
Thanks, I fixed it and now I am getting another error.
To explain the directory structure: the neo4j.py and init.py files are in the folder F:\app-python\api
I have made a new file here called myfile.py with the following code:
What I expect it to do is to call the create_app() from init.py which calls the init_driver(uri, username, password) from neo4j.py (containing the code from the top of this thread). I expect it to connect to the database.