سؤال

I am following the Neo4django manual: http://neo4django.readthedocs.org/en/latest/auth.html and trying to setup Admin's interface. I am working under Mac OS X.

Before I started setting up this interface, I had my server running and everything worked. After I made the indicated changes, the server stopped with the error: Error: No module named contenttypes. If I disable the contettypes line, I get the error Error: No module named admin.

In my settings.py file:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',      
    'django.contrib.admin',
    'polls',
    'mysite',
    'neo4django.admin',
    'neo4django.contenttypes',
)

In urls.py:

from django.conf.urls import patterns, include, url
from neo4django import admin

admin.autodiscover()

urlpatterns = patterns('',

    (r'^admin/', include(admin.site.urls)),
)

In admin.py:

from neo4django import admin
from .models import Person

class PersonAdmin(admin.ModelAdmin):
    pass

admin.site.register(Person, PersonAdmin)

Could please someone give me correct instructions for setting up the admin's page?

هل كانت مفيدة؟

المحلول

I suggest you throw away the entire tutorial for the moment and install neo4django with pip install -e git+https://github.com/scholrly/neo4django/#egg=neo4django. Also check the github https://github.com/scholrly/neo4django and when installing Django, don't install the latest version but the 1.5.4 version with pip install django==1.5.4 Also, install the 1.9.4 version of neo4j and not the 2.0 version.

If for any reason you find neo4django a bit complicated or not mature enough then you can try the py2neo library (not an ORM) or neomodel (https://github.com/robinedwards/neomodel)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top