Skip to main content
https://badge.fury.io/py/django-smuggler.svg https://travis-ci.org/semente/django-smuggler.svg?branch=master https://coveralls.io/repos/semente/django-smuggler/badge.png?branch=master

Django Smuggler is a pluggable application for Django Web Framework to easily dump/load fixtures via the automatically-generated administration interface. A fixture is file with model data serialized to e.g. JSON or XML that Django knows how to import to the database.

Smuggler is especially useful for transporting database data between production and development environments, but can also be used as a backup tool.

Project page

http://github.com/semente/django-smuggler

Translations

https://www.transifex.com/projects/p/django-smuggler/

Installing & Setup

Smuggler is in the Python Package Index (PyPI) and you can easily install the latest stable version of it using the tools pip or easy_install. Try:

pip install django-smuggler

or:

easy_install django-smuggler

Alternatively, you can install Smuggler from source code running the follow command on directory that contains the file setup.py:

python setup.py install

After installation you need configure your project to recognizes the Smuggler application adding 'smuggler' to your INSTALLED_APPS setting and setup the project URLConf like follow:

urlpatterns = [
    # ...
    path('admin/', include('smuggler.urls')),  # before admin url patterns!
    path('admin/', admin.site.urls),
]

Then try access these urls:

If you can access the URLs above, the application was setup correctly. Note that these URLs are accessible only by superusers.

Smuggler also provides a template to show buttons for dump and load data on change list page (change_list.html). You can setup the ModelAdmin you are interested like follow:

class ExampleAdmin(admin.ModelAdmin):
    change_list_template = 'smuggler/change_list.html'
    ...

Settings

Smuggler has the following settings available. You can set them in your project settings.py. If you doesn’t set them it will assume the default values:

SMUGGLER_EXCLUDE_LIST

List of models to be excluded from dump. Use the form ‘app_label.ModelName’. Default: [].

SMUGGLER_FIXTURE_DIR

Uploaded fixtures are stored in this directory (if requested). Default: None.

SMUGGLER_FORMAT

Format for dumped files. Any of the serialization formats supported by Django, json, xml and in some cases yaml. Default: ‘json’.

SMUGGLER_INDENT

Indentation for dumped files. Default: 2.

Screenshots

Buttons on change_list.html:

buttons on change_list.html

Load form (with SMUGGLER_FIXTURE_DIR configured):

load form

Release notes

Version 1.0.4 (2022-02-03)

  • Fix #76

Version 1.0.3 (2021-08-12)

  • Fix a bug in load form template

Version 1.0.2 (2020-09-28)

  • Support Django 3.1

Version 1.0.1 (2020-05-15)

  • Fix Python packaging setup

Version 1.0.0 (2020-04-20)

  • Support Django 3.0

  • Drop support for Python < 3.6 and Django < 2.2

Version 0.9.1 (2018-11-05)

  • Support Django 2.1

Version 0.9.0 (2018-03-22)

  • Support Django 2.0

  • Drop support for Django < 1.10

Version 0.8.0 (2016-11-09)

  • Support Django 1.10

Version 0.7.0 (2016-02-25)

  • Support Django 1.8

  • Support Django 1.9

  • Drop support for Django < 1.7

  • Drop support for Python < 2.7

Version 0.6.1 (2015-11-25)

  • Increase Django 1.7 compatibilty by supporting use_natural_foreign_keys and use_natural_primary_keys arguments for dumpdata

Version 0.6 (2014-09-18)

  • HTML5 multiple file upload is now supported for fixture uploads

  • Support loading fixtures from SMUGGLER_FIXTURE_DIR and upload at the same time

  • Recognize fixtures with upper case file extension correctly

  • Loading fixtures now uses loaddata management command

  • Removed signals.py

  • Removed sample templates

  • Cleaner code and better tests :-)

Version 0.5 (2014-08-21)

  • Added an option to specify a list of app labels to the /dump/ view

  • Improved test suite

  • Dropped Django 1.3 support

  • Preliminary Python 3 support

Version 0.4.1 (2013-11-12)

  • Changelist template is now Django 1.6 compatible

Version 0.4 (2013-04-01)

  • Django 1.5+ support;

  • Added German translation;

  • Added some tests.

Version 0.3 (2012-01-31)

  • Significant bug fixes and improvements when loading and exporting data;

  • Allow formats for import besides JSON and XML (aa105b3, needs documentation);

  • Added Dutch translation.

Version 0.2 (2011-08-19)

  • Django 1.2+ support;

  • Keep uploaded files as alternative choices to import (issues #1 and #6);

  • Vulnerability fixed (d73cec6);

  • Added Polish, Russian, Catalan and Brazilian Portuguese translations.

Version 0.1.1 (2010-01-20)

  • First stable version.

Backwards-incompatible changes

  • Removed AdminFormMixin (version 0.7)

  • Removed signals.py (version 0.6)

  • Renamed urls from import/export to load/dump (version 0.1)

Contributing

If you find any problems in the code or documentation, please take 30 seconds to fill out a issue here.

The contributing with code or translation is MUCH-APPRECIATED. Feel free to fork or send patches.

You can translate this application to your language using Transifex. Access the project page on Transifex.

See the AUTHORS file for a complete authors list of this application.

Thanks to Interaction Consortium for sponsoring the first releases of the project.

Tests

If you are contributing to django-smuggler we recommend setting up a virtualenv and running:

pip install -r test-requirements.txt

You can then run the tests with:

make tests

Before submitting a pull request please test against our supported versions of Python and Django by running:

tox

To see if you need to add tests we use coverage. You can generate a coverage report with:

make coverage

To check if your code follows the style guide you can run:

make lint

Copying conditions

Django Smuggler is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Django Smuggler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; see the file COPYING.LESSER. If not, see http://www.gnu.org/licenses/.

Release files for django-smuggler 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-smuggler 1.0.4
File Size Uploaded
django-smuggler-1.0.4.tar.gz 84.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-smuggler 1.0.4
File Interpreter ABI Platform
django_smuggler-1.0.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 151.1 kB

Release files / django-smuggler-1.0.4.tar.gz

Download URL django-smuggler-1.0.4.tar.gz
Size 84.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e53b02bdc48c94012950d5fa4e4b30bc4259e62fc986d22b9d571de1a45dcc80
BLAKE2b-256 checksum
How to use checksums
59d83601b5fa35b3710af0af6124e71b78f49b85936e8111864013879f9f4d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.6.4 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.10

Release files / django_smuggler-1.0.4-py2.py3-none-any.whl

Download URL django_smuggler-1.0.4-py2.py3-none-any.whl
Size 66.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
49db0724d8b8ffb84e93581f12d363d4113f1b9ef07c74c1cdd63f8752397b8c
BLAKE2b-256 checksum
How to use checksums
e2a1deb5b0189df0cd6138d0c36356b2f2909e87ee61850bc8142e5486075a53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.6.4 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.10

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

1 release file

1.0.2

2 release files

1.0.1

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page