Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

grunt-django-manage-2

0.1.3 • Public • Published

Build Status devDependency Status

grunt-django-manage

Grunt tasks to run common django management commands

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-django-manage --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-django-manage');

Usage

Basic setup

grunt.initConfig({
    'django-manage': {
        options: {
            app: 'myApp',
            settings: 'test'
        },
        loaddata: {
            options: {
                command: 'loaddata',
                args: [
                    './fixtures/user.json',
                    './fixtures/postcodes.json'
                ]
            }
        }
    }
});

To run a loaddata command with django-manage you would run the following

Running

grunt django-manage:loaddata
// This will run
// python manage.py loaddata ./fixtures/user.json ./fixtures/postcodes.json --settings=myApp.settings.test

Changing options in commands

grunt.initConfig({
    'django-manage': {
        options: {
            app: 'myApp',
            settings: 'test'
        },
        loaddata: {
            options: {
                command: 'loaddata',
                args: [
                    './fixtures/user.json',
                    './fixtures/postcodes.json'
                ]
            },
            live: {
                settings: 'live'
            }
        }
    }
});

To run loaddata using live settings you would instead run

grunt django-manage:loaddata:live
// This will run
// python manage.py loaddata ./fixtures/user.json ./fixtures/postcodes.json --settings=myApp.settings.live

Contribuiting

If you would like to contribute to the project please check the CONTRIBUTING file

License

The license file can be found here

Install

npm i grunt-django-manage-2

DownloadsWeekly Downloads

1

Version

0.1.3

License

MIT

Last publish

Collaborators

  • avatar