The Admin Interface

After a few settings tweaks, you can use the admin interface.

You’ll need neo4django’s Authentication working properly, as well as its prerequisites like django.contrib.sessions.

Add neo4django.admin and neo4django.contenttypes to your INSTALLED_APPS. Also include django.contrib.admin and django.contrib.contenttypes, but make sure they come after the neo4django versions.

In your, instead of importing django.contrib.admin, import neo4django.admin:

from neo4django import admin


urlpatterns = patterns('',
    (r'^admin/', include(,

And in your app’s, do the same:

from neo4django import admin
from my_app.models import MyModel

class MyModelAdmin(admin.ModelAdmin):
    ..., MyModelAdmin)

Since we don’t use syncdb, you probably won’t have created a neo4django superuser. Run shell and create a superuser with:

from neo4django.graph_auth.models import User
User.objects.create_superuser('matt', '', 'password')

Run runserver, and visit http://localhost:8000/admin. Voila. Sign in and enjoy.

Usage with Relational Databases

The integration hasn’t been tested using both Neo4j and a relational database. The two databases certainly wouldn’t be able to share an admin site, but it might be possible to run them as separate admin sites with their own URLs.

As example routing might look like:

from django.contrib import admin

from neo4django import admin as neo_admin

urlpatterns = patterns('',
    (r'^admin/', include(,
    (r'^neo_admin/', include(

If you give this a try, please let us know how it goes!


The integration is new, and only basic features have been tested. Known limitations include broken “View on Site” and “History” buttons, but more will surely be found. If you have any trouble, please raise an issue!