On Fri, Jul 15, 2011 at 2:33 AM, Richard Schwab <endur...@gmail.com> wrote:

> Hello,
> I'm having difficulty integrating Django and Neo4j. I've tried it on
> several
> different systems including Mac OSX 10.6.8 and Ubuntu 11.04. Perhaps
> someone
> can give me some feedback or suggestions? I'm good with Django but haven't
> played with VirtualEnv, Jython or Neo4j before.
>
> Here is the error I'm getting trying the steps at thobe.org's seamless
> neo4j
> integration in django:
>
> == Error ==
> ValueError: Unable to configure filter 'require_debug_false': Cannot
> resolve
> 'django.utils.log.CallbackFilter': No module named CallbackFilter
>
> == Steps ==
> Mainly using
> http://journal.thobe.org/2009/12/seamless-neo4j-integration-in-django.html
> ,
> I'm following these steps and I apologize if these are unnecessary, I'm
> just
> trying to give more info to get to an answer quickly.
>
>   1. VirtualEnv
>      1. Install virtualenv ($ sudo apt-get install virtualenv)
>      2. Set up a virtualenv ($ virtualenv TestEnv)
>      3. Activate the virtualenv ($ source TestEnv/bin/activate)
>   2. Jython - 2.5.2 (I've also tried 2.53b and no luck)
>      1. Download jython (sourceforge.net) & uncompress
>      2. Copy jython to /usr/lib, make symbolic link ($ ln -s
>      /usr/lib/jython2.5.2/lib/jython /usr/bin/jython)
>   3. Neo4j - 1.4
>      1. Download Neo4j ($ svn co
>      https://svn.neo4j.org/components/neo4j.py/trunk neo4j-python)
>      2. Install Neo4j ($ sudo jython setup.py install)
>      3. Tested: jython: import neo4j works
>   4. Django - 1.3.0
>      1. Download & extract Django (https://www.djangoproject.com/download/
> )
>      2. Install Django ($ sudo jython setup.py install)
>      3. Tested: jython: import django works
>   5. Django-Jython - 1.2.0
>      1. Download & extract Django-Jython (
>      http://code.google.com/p/django-jython/downloads/list)
>      2. Install Django-Jython ($ sudo jython setup.py install)
>   6. Created a Django-Admin-Jy ln ($ alias django-admin-jy="jython
>   /usr/lib/jython2.5.2/Lib/site-packages/django/bin/django-admin.py")
>   7. Created a Django Project ($ django-admin-jy startproject neo4django)
>   8. Created a Django App ($ jython neo4django/manage.py startapp business)
>   9. Edited settings.py
>      1.
>
>      Edit settings.py
>
>      NEO4J_RESOURCE_URI = '/var/neo4j/neo4django'
>
>      # NEO4J_RESOURCE_URI should be the path to where
>
>      #    you want to store the Neo4j database.
>
>
>      NEO4J_OPTIONS = {
>
>          # this is optional and can be used to specify
>
>          # extra startup parameters for Neo4j, such as
>
>          # the classpath to load Neo4j from.
>
>      }
>      10. Edited business/models.py
>      1.
>
>      from neo4j.model import django_model as model
>
>
>      class Person(model.NodeModel):
>
>          first_name = model.Property()
>
>          last_name = model.Property()
>
>          def __unicode__(self):
>
>              return u"%s %s" % (self.first_name, self.last_name)
>
>
>      class Company(model.NodeModel):
>
>          name = model.Property(indexed=True)
>
>          owners = model.Relationship(Person,
>
>              type=model.Outgoing.OWNED_BY,
>
>              related_name="owns",
>
>          )
>
>          employees = model.Relationship(Person,
>
>              type=model.Incoming.WORKS_AT,
>
>              related_name="employer",
>
>              related_single=True, # Only allow Persons to work at one
>      Company
>
>          )
>
>          def __unicode__(self):
>
>              return self.name
>      11. Tested it out: $ jython neo4django/manage.py shell results in the
>   error (same as written above)
>      - ValueError: Unable to configure filter 'require_debug_false': Cannot
>      resolve 'django.utils.log.CallbackFilter': No module named
> CallbackFilter
>
> So all that said if anyone has any ideas, I'd appreciate it immensely. I
> was
> wondering also if my versioning was correct, or if I should drop to some
> older versions of django perhaps? It doesn't seem like there's been much
> work on this since 2009.
>

That is a very good suspicion. That Django has changed since I wrote that
code, and that article.
Trying an older version of Django might do the trick. Sadly I can't find
which version of Django I used back then.

However, there is no use of CallbackFilter in my code, which seems to imply
that this would be a problem in Django.
Looking at the Django documentation:
https://docs.djangoproject.com/en/dev/topics/logging/#id3 the CallbackFilter
feature seems to not be released yet. How it got into your settings.py (I'm
guessing that is where 'require_debug_false' is configures) I don't know. If
I had not had your complete description of everything you did, I would have
guessed that you either:
a) Followed the documentation of the wrong version of Django from their
website (the dev version is easier to find then the ones for released
versions). Or
b) Used a newer version of Django to auto-generate the settings.py file, and
then an older version to run the code.

But since neither of those steps are in your description, my best guess is
that the Django folks released parts of that feature too early. You'd think
there be more mentionings of this problem online then though. Do you think
you could grep through your settings.py for CallbackFilter
and/or require_debug_false to see if that might be the problem.

Cheers,
-- 
Tobias Ivarsson <tobias.ivars...@neotechnology.com>
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to