Gulp Task for Django runserver -
I am trying to create an action to start my Django backend.
I took a lot of time to solve them
- Search correctly to activate virtual environment
- stdout Get the manage.py runerver for output
I've put together a solution to search for hours.
I hope this will save a lot of time and frustrationBelow are fiction works, coffeescript Written in, the Django backend will begin:
exec = requires ('child_process'). Exec gulp.task 'service: backend', - & gt; Proc = exec 'Source Bin / Active; PYTHONUNBUFFERED = 1 ./manage.py driver 'proc.stderr.on' data ', (data) - & gt; Process.stdout.write data proc.stdout.on 'data', (data) - & gt; Process.stdout.write data
You can run the job with
Bulk Service: Backend
Note:- You will not need to install any node package, built in child_process.
- Use the parameter instead of span to be able to run multiple commands in one call
- Not only stdout but stderr handle as well or you can log in to your logs Do not forget the request
- Do not forget PYTHONUNBUFFERED or you will not see anything in your console (grmbl)
Comments
Post a Comment