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.
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
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 = patterns('', # ... (r'^admin/', include('smuggler.urls')), # before admin url patterns! (r'^admin/', include(admin.site.urls)), )
Then try access these urls:
/admin/load/, to load data from uploaded files or files on SMUGGLER_FIXTURE_DIR;
/admin/dump/, to download data from whole project;
You can also pass in a querystring like /admin/dump/?app_label=flatpages,auth,yourapp.model to specify what must be dumped.
/admin/APP_LABEL/dump/, to download data from a app;
/admin/APP_LABEL/MODEL_LABEL/dump/, to download data from a model;
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' ...
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:
Buttons on change_list.html:
Load form (with SMUGGLER_FIXTURE_DIR configured):
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 patchs.
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.
If you are contributing to django-smuggler we recommend setting up a virtualenv en running:
pip install -f test-requirements.txt
You can then run the tests with:
Before submitting a pull request please test against our supported versions of Python and Django by running:
To see if you need to add tests we use coverage. You can generate a coverage report with:
To check if your code follows the style guide you can run:
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/.
GNU Lesser General Public License v3 or later (LGPLv3+)
|File||Type||Python Version||Uploaded On||Downloads|
|django_smuggler-0.6.0-py2.py3-none-any.whl||Wheel||2.7||Sept. 18, 2014||3,637|
|django-smuggler-0.6.0.tar.gz||Source||Sept. 18, 2014||1,398|
|0.6.0||Sept. 18, 2014|
|0.5.0||Aug. 21, 2014|
|0.4.1||Nov. 12, 2013|
|0.4||April 2, 2013|
|0.3||Jan. 31, 2012|
|0.2||Aug. 19, 2011|
|0.1.1-final||Aug. 26, 2015|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.5.0||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.4.1||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.4||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.6.0||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.3||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.2||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||0.1.1-final||Release Created|
|Aug. 26, 2015, 12:26 a.m.||django-smuggler||Package Created|