django shellで実行されるsqlを表示する


python shell_plus --bpython --print-sql
$ python help shell_plus 
Usage: shell_plus [options]

Like the 'shell' command but autoloads the models of all installed Django apps.

  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        A directory to add to the Python path, e.g.
  --traceback           Raise on exception
  --plain               Tells Django to use plain Python, not BPython nor
  --bpython             Tells Django to use BPython, not IPython.
  --ipython             Tells Django to use IPython, not BPython.
  --notebook            Tells Django to use IPython Notebook.
  --use-pythonrc        Tells Django to execute PYTHONSTARTUP file (BE
                        CAREFULL WITH THIS!)
  --print-sql           Print SQL queries as they're executed
                        Ignore autoloading of some apps/models. Can be used
                        several times.
  --quiet-load          Do not display loaded models messages
  --version             show program's version number and exit
  -h, --help            show this help message and exit


関連 : Djangoでrailsのrake routesみたいな機能 - brainstorm