--- id: django-clone version: "5.5.0" license: MIT/Apache-2.0 license_treatment: permissive maintenance: active --- # django-clone — Create a clone of a django model instance. License: permissive · Maintenance: active · Downloads: 221.4K/mo ## What it is and what it does django-clone provides a mixin and model base class that lets you duplicate Django model instances with explicit control over which fields and relationships get copied. Instead of the naive `instance.pk = None; instance.save()` approach—which copies more state than intended—this package lets you specify exactly which fields, many-to-many relationships, and one-to-many relationships should be included in the clone. It automatically detects unique fields and appends a suffix to avoid constraint violations. The package integrates with Django Admin, allowing cloning directly from list and change views. It supports multi-database operations, signals for pre- and post-clone hooks, and both explicit (include-only) and implicit (exclude-only) field selection. It has been actively maintained since its first release, supports Django 2.x through 4.x, and works with Python 3.6 and later. Use it for: - Duplicate a product listing in an e-commerce app while automatically handling unique SKU fields. - Clone a survey or form template with all its questions and options, excluding responses. - Create a copy of a project or task in a project management tool without duplicating timestamps or status fields. - Bulk-clone model instances across multiple databases in a multi-tenant application. - Add a 'Duplicate' action to Django Admin for quick instance copying with controlled field selection. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Duplicates Django model instances with fine-grained control over which fields and relationships are copied, automatically handling unique field conflicts. Yes. The package solves a real Django problem (safe model duplication) with low install friction, active maintenance, no known vulnerabilities, and permissive licensing. It is well-tested and integrates cleanly with Django Admin. Install it if you need to duplicate model instances with control over which fields and relationships are copied. ## Install pip install django-clone uv add django-clone poetry add django-clone ## Installing django-clone Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and no known vulnerabilities. Depends only on django, conditional, and six. License in practice: Dual-licensed under MIT and Apache-2.0 (permissive). Either license permits commercial and private use with minimal restrictions. Quickstart: pip install django-clone from django_clone import CloneMixin class MyModel(CloneMixin, models.Model): name = models.CharField(max_length=100) original = MyModel.objects.get(pk=1) clone = original.clone() Requires Django 2.0 or later; Python 3.6+. Must add django-clone to INSTALLED_APPS before django.contrib.admin if using admin integration. Verify before relying: - Whether the package handles all Django ORM field types without manual intervention. - Performance characteristics when cloning instances with large many-to-many or one-to-many relationship sets. - Exact behavior of unique field suffix generation when multiple clones are created in rapid succession. ## Package facts - License: MIT/Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 221.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django model cloning, duplicate django instances, django object duplication, clone model fields, django model copying, unique field handling, django instance clone, django-orm, model-duplication, admin-integration [View on SkillFed](https://skillfed.io/packages/django-clone) · [View on PyPI](https://pypi.org/project/django-clone/)