Django Tag Me... Tag a model, a field, user tags and more...
  • Python 74.5%
  • HTML 14.9%
  • CSS 6.5%
  • JavaScript 4.1%
Find a file
2026-06-01 01:26:48 +00:00
.forgejo refactor(readme): Convert from .rst to .md, remove git-herald version #348 2026-05-31 14:06:52 +08:00
.github_OG refactor(forge): Update to use git-herald #345 2026-05-30 07:01:03 +08:00
docs chore(version): Bump to 2026.05.31.2 2026-05-31 23:34:12 +00:00
example chore(deps): Update example project django #299 2025-11-20 13:54:35 +08:00
frontend feat(widget): Swap tag in single-select mode and add a mode indicator #350 2026-06-01 06:42:42 +08:00
tag_me chore(version): Bump to 2026.05.31.2 2026-05-31 23:34:12 +00:00
tests test(unit): Add public-import and circular-import regression guards #351 2026-06-01 06:45:21 +08:00
.coveragerc test(tags): Update all tests for new tag management #248 2025-02-18 14:14:36 +08:00
.gitignore fix(asset): Improve manifest loading robustness and type safety #287 (#288) 2025-10-25 15:04:03 +08:00
.pre-commit-config.yaml test(cmd): Add tests for custom mgmt commands #31 (#32) 2023-09-26 13:50:22 +08:00
.readthedocs.yaml chore(dep): Update graphviz #145 (#147) 2024-07-09 17:10:28 +08:00
__init__.py chore(tags): Port code from private repos TB and BS (#6) 2023-09-07 14:37:58 +08:00
AGENTS.md docs(llm): Add CLAUDE.md and llms.txt #343 2026-05-29 16:15:50 +08:00
CHANGELOG.md chore(version): Bump to 2026.05.31.2 2026-05-31 23:34:12 +00:00
CLAUDE.md docs(compat): Reconcile docs with re-exports, Django 4.2, and git-herald #351 2026-06-01 06:38:59 +08:00
CONTRIBUTING.md fix(docs): Update errors in setup process for dev #227 2025-01-24 15:36:03 +08:00
LICENSE docs(pypi): Fix format so pypi displays correctly #200 2024-12-16 10:06:59 +08:00
manage.py refactor(management): Add command to python path #320 2026-01-05 16:26:24 +08:00
MANIFEST.in docs(llm): Add CLAUDE.md and llms.txt #343 2026-05-29 16:15:50 +08:00
pyproject.toml chore(version): Bump to 2026.05.31.2 2026-05-31 23:34:12 +00:00
README.md docs(readme): Swap downloads to peppy #353 2026-06-01 09:19:06 +08:00
requirements.txt deps(pkg): Update/consolidate #192 2024-12-15 07:37:22 +08:00
tox.ini refactor(compat): Drop Django 4.0/4.1 and clean up refactor fallout #351 2026-06-01 06:44:24 +08:00
version.toml chore(version): Bump to 2026.05.31.2 2026-05-31 23:34:12 +00:00

Django Tag Me

Project Status: Active PyPI - Version PyPI - Python Version PyPI - Versions from Framework Classifiers Documentation Status

Total downloads Monthly downloads Weekly downloads

Simple, flexible tagging for Django.

Add tags to any Django model field -- with a polished widget, per-user tag customization, and automatic resilience to model renames.

Features

  • Easy setup -- Add TagMeCharField to your model and go
  • Beautiful widget -- Searchable dropdown with tag pills, powered by Alpine.js
  • User tags -- Each user gets their own customizable tag set per field
  • System tags -- Define default tags available to all users
  • Tag synchronization -- Keep tags in sync across related models
  • Model rename resilient -- FK-based lookups with automatic orphan detection and repair
  • CLI diagnostics -- Health checks, orphan repair, and built-in troubleshooting via tag_me command
  • Structured logging -- Observability via structlog for production monitoring
  • Form integration -- Drop-in mixin for your model forms
  • Template tags -- Display tags as styled pills

Quick Example

# models.py
from tag_me.models import TagMeCharField

class Article(models.Model):
    tags = TagMeCharField(blank=True)
    category = TagMeCharField(choices=CategoryChoices.choices, system_tag=True)
# forms.py
from tag_me.forms import TagMeModelFormMixin

class ArticleForm(TagMeModelFormMixin, forms.ModelForm):
    class Meta:
        model = Article
        fields = ["tags", "category"]

See the Quickstart for the full setup including templates and frontend requirements.

Widget Preview

Dropdown with tag options

Tag dropdown with options

Search and filter tags

Tag dropdown search functionality

Model Rename Resilience

Rename your Django models without breaking tags. Tag-me uses ContentType foreign keys instead of model name strings, and automatically detects and merges orphaned records during migration.

# Rename your model, then:
python manage.py makemigrations   # answer "yes" to rename prompt
python manage.py migrate          # tag-me handles the rest

# Verify everything is clean:
python manage.py tag_me check

See How to Upgrade to FK Lookup for details on the FK-based system.

Management Command

Tag-me includes a CLI for diagnostics and administration:

python manage.py tag_me populate              # create/update tags
python manage.py tag_me check                 # data integrity audit
python manage.py tag_me fix-orphans --dry-run # preview orphan repair
python manage.py tag_me help                  # built-in documentation

Tag population runs automatically after every migrate. The CLI exists for diagnostics, manual repair, and single-user operations.

See How to Use the Tag-me CLI for the full guide.

Installation

pip install django-tag-me

See the documentation for setup and usage instructions.

Credits