Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Python localhost through Grunt

Tags:

python

gruntjs

I am relatively new to Gruntjs, but I've managed to get everything running automatically, except my localhost.

How can I make Grunt run python manage.py runserver 0.0.0.0:8000 --insecure ?

like image 498
Jon Snow Avatar asked Dec 11 '22 10:12

Jon Snow


1 Answers

You can use grunt-shell https://github.com/sindresorhus/grunt-shell

Try something like this:

grunt.initConfig({
    shell: {
        pythonServer: {
            options: {
                stdout: true
            },
            command: 'python manage.py runserver 0.0.0.0:8000 --insecure'
        }
    }
});

grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['shell:pythonServer']);

I hope it helps :) Cheers

like image 57
Tobias Oberrauch Avatar answered Dec 20 '22 15:12

Tobias Oberrauch