[Answer]-How to display Iftop within Django

1👍

iftop uses ncurses, which means you won’t capture it with STDOUT. Looking at the help, you can provide this option:

-t text output mode
       Use text interface without ncurses and print the output to STDOUT.

So try passing this argument in, it may solve your problem.

There’s a problem here though, your web server shouldn’t be allowed to sudo. That’s a serious security problem. You could consider making a very simple Django app which runs only this command and doesn’t handle any other data to reduce the attack surface.

👤Joe

Leave a comment