1

I'm currently trying to use pudb to troubleshoot a django application. In order to do so, I'm running the runserver instead of gunicorn.

Then, when I want to debug, I added:

import pudb; pu.db

The pudb gui shows up correctly but is quickly garbled by the runserver output.

As per pudb documentation, I can avoid this by setting the PUDB_TTY variable before starting the server.

$ tty
/dev/pts/3
$ PUDB_TTY=/dev/pts/3 manage.py ... runserver ...

Unfortunately, the GUI still gets garbled by the output of the server.

Alternatively, I tried to redirect all output from the runserver (>/dev/null 2>&1), but the pudb output also get caught (obviously).

Is there a way to:

  • have the runserver not produce any output?
  • tweak pudb ?
E. Jaep
  • 2,095
  • 1
  • 30
  • 56

1 Answers1

1

It looks like the TTY redirect feature is only available in the Development branch

I was able to get it to work with:

$> git clone https://github.com/inducer/pudb
$> cd pudb
$> python setup.py install

In terminal 1:

$> tty 
   # Outputs: /dev/pts/5
$> perl -MPOSIX -e pause

In terminal 2:

$> PUDB_TTY=/dev/pts5 python manage.py runserver
koepnick
  • 49
  • 1