#I'm looking for a tool to run runserver and npm start in one command with multiplexed output
31 messages ยท Page 1 of 1 (latest)
For development? Or for production? Why must it be multiplexed? What OS ?
I think you have to use two terminals
Python manage.py runserver on one end and npm start on the other
Just for development
It needs to be multiplexed for debug output
Currently my team are opening two terminals and running two programs
I want one command that does both
Use docker compose?
We don't use docker
Also the multiplexing doesn't work well with vite
and breakpoint() in Django
Write a script then, but the solution you're looking for is docker compose ๐
Or tmuxp with two panes ๐ค
Oh that looks good
No need to write the script anymore, I use "White Noise" it runs both npm and Django together very easy to use
npm-run-all https://github.com/piepworks/blaze-starter/blob/565a28517576b64483cbdb4ba3a9e35b714602e7/package.json#L11
what is multiplexed output? i've used docker image with prebuilt vuejs app and fastapi running on single gunicorn server as static content before , should work with django as well
Docker compose is the only common tool i have seen doing it - if you have multiple containers running it will merge the stdout log output from all containers into one terminal/view, and color code them so you can separate the output. So you can watch the output from all containers at once.
I think you want to see two logs in the same screen sorted by timestamp.
You can redirect the stdout/stderr of two programs to the same file, then you can see it all together:
program_log1 > /tmp/debug.log
program_log2 >> /tmp/debug.log
tail -f /tmp/debug.log
This is a simple shell script, you do not need more complex programs to see two logs at the same time.
Anyway, docker and docker compose is a good friend to do this and more things.
I have the same structure in development environment for webpack + django dockerized project, docker is the best option for this case.
No not logs, stdout and stderr of two processes merged
I want arbitrary processes without docker
it is the same 2> for stderr and > for stdout
Can you show a complete runable example?
For development
Ah interesting but it was published 6 years ago, I'm looking for something a little more recent and in C, Rust or Python
This won't work because program_log1 won't ever terminate
test it, it works
Oh wow! I had no idea it was abandoned! ๐ฌ
No it won't work because program_log1 will never finish so there's no way to run program_log2