I'm trying to create a task to start my Django backend.
It took me quite a while to solve these two challenges:
After searching for hours I have put together a solution.
I hope this will save someone a lot of time and frustration
The gulp task below, written in coffeescript, will start the Django backend:
exec = require('child_process').exec
gulp.task 'serve:backend', ->
proc = exec 'source bin/activate; PYTHONUNBUFFERED=1 ./manage.py runserver'
proc.stderr.on 'data', (data) -> process.stdout.write data
proc.stdout.on 'data', (data) -> process.stdout.write data
You can run the task with gulp serve:backend
Note:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With