通过Grun运行Python localhost

2024-10-03 06:29:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我对Gruntjs还比较陌生,但我已经成功地让所有东西都自动运行,除了我的本地主机。在

如何让Grunt运行python manage.py runserver 0.0.0.0:8000 --insecure?在


Tags: pymanagegruntrunserverinsecure陌生gruntjs
1条回答
网友
1楼 · 发布于 2024-10-03 06:29:00

您可以使用grunt shell https://github.com/sindresorhus/grunt-shell

试试这样的方法:

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']);

我希望这有帮助:) 干杯

相关问题 更多 >