Showing posts with label Practical Django Projects. Show all posts
Showing posts with label Practical Django Projects. Show all posts

Thursday, July 16, 2009

Practical Django Projects, coltrane weblog app and django-tagging

I'm working through Practical Django Projects 2nd Edition.

There is a problem with Chapter 4's weblog application, "coltrane." I won't go into detail about the coltrane app, but in the event that you encounter the same problem I've posted a solution.

I downloaded django-tagging. The current version was 0.2.1.

I created a symlink from my projects directory to the downloaded directory.

I added "'taggigng'" to "INSTALLED_APPS" and tried to start the server. I got the following :
Validating models...
Unhandled exception in thread started by <function inner_run at 0x652c30>
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/django/core/management/commands/runserver.py", line 48, in inner_run
self.validate(display_num_errors=True)
File "/Library/Python/2.5/site-packages/django/core/management/base.py", line 246, in validate
num_errors = get_validation_errors(s, app)
File "/Library/Python/2.5/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Library/Python/2.5/site-packages/django/db/models/loading.py", line 128, in get_app_errors
self._populate()
File "/Library/Python/2.5/site-packages/django/db/models/loading.py", line 57, in _populate
self.load_app(app_name, True)
File "/Library/Python/2.5/site-packages/django/db/models/loading.py", line 72, in load_app
mod = __import__(app_name, {}, {}, ['models'])
File "/[path to django projects]/coltrane/models.py", line 6, in <module>
from tagging.fields import TagField
File "/[path to django projects]/tagging/fields.py", line 10, in <module>
File "/[path to django projects]/tagging/models.py", line 9, in <module>
File "/[path to django projects]/tagging/managers.py", line 6, in <module>
ImportError: cannot import name parse_lookup
Sweet!

Turns out a lot of people have had this problem.

I checked out the current version from svn and recreated the symlink. All was well.