• About
scot hacker's scripts and utils

Django-Taggit

May 17, 2011 11:49 pm / 3 Comments / shacker

Alex Gaynor’s Django-Taggit is a great piece of software, but was missing two features essential for Bucketlist:

1) Users could create tags “Music” and “music” which would create two logically different taxonomies on the site, which was confusing and messy. I’ve added a settings option to force lowercase. When this is enabled, all tags will be lowercased as they’re submitted, preventing duplication.

2) Many users don’t read instructions, and enter multi-word tags without quotes, which results in the system being polluted with lots of tags “the”, “of”, “an” etc. You can now define a set of “stopwords” in settings. Any detected stop words will be removed from the submitted tag set.

I forked Gaynor’s taggit to add these features. See shacker/django-taggit.

I also wrote a script to fix all of the duplicate tags that had gone into the system after installing the original django-taggit but before doing my forked version. You’ll find that script on the repo’s Wiki page.

Posted in: Django

3 Thoughts on “Django-Taggit”

  1. Aaron Bassett on May 18, 2011 at 8:59 am said:

    Rather than defining a list of stopwords you could add support for NLTK.

    >>> from nltk.corpus import stopwords
    >>> stopset = set(stopwords.words(‘english’))

    This could also help you remove a lot more duplication. Converting to lower case is a great start, but what about pluralisations? You could end up with tags “walk”, “walks”, “walking”, “walked” when really a search for any one should also return the others. With NLTK you can easily stem or lemmatize tags reducing this duplication.

  2. shacker on May 18, 2011 at 10:55 am said:

    Aaron, this is a great tip, thanks! I hadn’t heard of NLTK before, but will look into it. Nice.

  3. Eugeny on December 21, 2011 at 12:48 am said:

    Cool man!

    Very useful app.

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation

← Previous Post
Next Post →

Categories

  • AMP
  • BeOS
  • cPanel
  • Django
  • Geo
  • Mac
  • Movable Type
  • Music
  • Performance
  • Python
  • QuickTime Streaming Server
  • Spam
  • Twitter
  • WordPress
© Copyright 2025 - scot hacker's scripts and utils
Infinity Theme by DesignCoral / WordPress