django-clone
Create a clone of a django model instance.
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 on this page — 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
django-clone on PyPI
pip
pip install django-cloneuv
uv add django-clonepoetry
poetry add django-cloneInstalling 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 the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — django, conditional, six |
| Maintenance | actively maintained — 430 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 221,419/month — #9,278 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_clone-5.5.0-py3-none-any.whl
Keywords: django, django-clone, django clone, django object clone, clone-django, model cloning, django instance duplication, django duplication
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
django-reversiondjango-reversion adds version control to Django…
permissive · top 5,000 on PyPI
django-upgradeAutomatically modernizes Django project code by…
permissive · top 15,000 on PyPI
django-cleanupAutomatically deletes old files when Django…
permissive · top 15,000 on PyPI
polyfactoryPolyfactory generates mock data objects from…
permissive · top 5,000 on PyPI
djangorestframework-queryfieldsAllows Django REST framework API clients to…
permissive · top 15,000 on PyPI
django-postgres-copyProvides Django ORM integration for…
permissive · top 5,000 on PyPI
django-dirtyfieldsTracks which fields on a Django model instance…
permissive · top 15,000 on PyPI
django-autoslugProvides a Django model field that…
copyleft · top 15,000 on PyPI
chacha20poly1305-reuseableProvides a reusable ChaCha20Poly1305 AEAD…
permissive · top 15,000 on PyPI
django-jsonfieldProvides a JSONField for Django models that…
permissive · top 15,000 on PyPI