July 20–24, 2015
Portland, OR

Building a Python web application using Flask and Neo4j

Nicole White (Neo4j)
1:30pm–5:00pm Monday, 07/20/2015
Data D137/138
Average rating: ***..
(3.33, 6 ratings)
Slides:   external link,   external link

Prerequisite Knowledge

Attendees will benefit the most if they are already familiar with the Python programming language. Knowledge of Neo4j is not necessary; the tutorial allows for a Neo4j primer. However, attendees with some SQL experience will more appreciate the transition from SQL to NoSQL.

Materials or downloads needed in advance

You will need a laptop with Python and Neo4j installed and a GitHub account.


Flask, a popular Python web framework, has many tutorials available online which use an SQL database to store information about the website’s users and their activities. While SQL is a great tool for storing information such as usernames and passwords, it is not so great at allowing you to find connections among your users for the purposes of enhancing your website’s social experience.

In this tutorial, we will replace SQL with Neo4j, an open source graph database, in order to build a simple microblog application. We will incorporate social features that are otherwise too complex to model and express in SQL, including recommending similar users to the logged-in user, along with displaying similarities between two users when one user visits another user’s profile.

Prior to diving into the application, we will go over some Neo4j basics including data modeling and querying—just enough to get us comfortable building an application on top of Neo4j.

Photo of Nicole White

Nicole White


Nicole White grew up in Kansas City, Missouri. She spent four years at LSU in Baton Rouge, Louisiana where she earned a degree in economics with a minor in mathematics. She then went to the University of Texas at Austin, where she received her master’s degree in analytics. It was during this time that she found Neo4j and began exploring its capabilities. When she’s not graphing all the things, she spends her time playing card games and board games.

Comments on this page are now closed.


Picture of Nicole White
Nicole White
07/20/2015 4:05pm PDT

Hey all, thanks for coming!

To see the full, completed project: https://github.com/nicolewhite/neo4j-flask

There’s also a walkthrough: http://nicolewhite.github.io/neo4j-flask/

This might differ from what I coded live but it’s pretty much the same. Enjoy the rest of OSCON!

Picture of Nicole White
Nicole White
07/20/2015 3:22am PDT

Neo4j isn’t hosted on any local server. Come to the hack zone if you can’t download from the website; we have it on USB sticks.

Picture of Audra Carter
Audra Carter
07/20/2015 2:22am PDT

Hi Bradley,

You can access the training downloads on the local server. Just make sure you’re connected to the attendee wi-fi when trying to access it.

Bradley Shoemaker
07/20/2015 1:57am PDT

The Neo4j download from the link that was emailed keeps timing out. It’s not related to my wifi connection. Is there another way to download it?

Picture of Nicole White
Nicole White
07/19/2015 3:44pm PDT

@Meryll You’ll be happier on Linux.

@Dave We’ll only be learning the basics of Flask, enough to build a full webapp.

David Briccetti
07/19/2015 2:15pm PDT

Hi. How much Flask will we learn here? As I’m reading it, it’s mostly about Neo4j. Thanks.

Meryll Larkin
07/19/2015 6:27am PDT

I have a dual-boot laptop with both Fedora and Windows. I can’t login to both at the same time :-). So for this class, which would be a better choice for the setup?