0.1.3 • Published 9 years ago
grunt-django-manage-2 v0.1.3
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