Reputation: 488
I'm pretty new to Python (2.7) and Django (1.3.1) and I'm not sure where what the next step for debugging this issue should be. A little background, this app is running just fine in my production environment which is on an EC2 instance running Ubuntu. I'm having trouble getting it running on my dev machine running Mountain Lion. I've followed what seems like standard practice and used virtualenv to keep everything properly sandboxed.
The error is happening when trying to render this pretty innocuous line:
<meta property="facebook:login_url" content="{% url socialauth_begin 'facebook' %}" />
The exception being thrown:
Exception Value: Caught ImportError while rendering: cannot import name prepare_lookup_value
Exception Location: /dev/Sites/whattest/env/lib/python2.7/site-packages/grappelli/views/related.py in <module>, line 15
line 15: from django.contrib.admin.util import prepare_lookup_value
I assume that it's a path problem of some kind but I'm at a loss for where / how to track it down at this point.
Upvotes: 0
Views: 710
Reputation: 38247
The current version of django-grappelli is compatible with Django 1.4 and 1.5; so I assume django.contrib.admin.util.prepare_lookup_value
, which is being imported by django-grapelli, is simply not available in Django 1.3.
And in any case, I don't see why anybody would start something new with an such old version of Django, unless it was for legacy reasons.
UPDATE: actually, this precise issue does not seem to be the case—prepare_lookup_value
was introduced in 2011 and 1.3 was released in 2013, deciding by git blame
. However, the location of that function has changed from django.contrib.{util to utils}
, and your code is trying to import django.contrib.admin.util.prepare_lookup_value
.
Since you seem to be using old versions of (at least some) packages, I'd suggest upgrading all packages (incl. django-grapelli) in your venv to their latest versions and seeing if the problem persists.
Upvotes: 2